Hi,
I'm passing a dirPartyType from a service as a string. but the problem with using str2Enum was that if i passed "Person" or "Per" then it will consider it as Person. But i should get invalid dirPartyType if i passed "Per"
DirPartyType dirPartyType;
Test::create(str2Enum(dirPartyType,_req.DirPartyType()) // where req.DirPartyType() is filled from .Net a string
public static Test create(DirPartyType _dirPartyType)
{
if(_dirPartyType == DirPartyType::Person)
{
return new TestPCreator();
}
else if(_dirPartyType == DirPartyType::Organization)
{
return new TestOCreator();
}
else
{
throw error('Invalid DirPartyType');
}
}
So it was suggested that i should use DictEnum and indeed it solved my problem and detected "Per" as invalid
DictEnum dictEnum = new DictEnum(enumNum(DirPartyType));
Test::Creater(dictEnum.symbol2Value(_req.DirPartyType()));
1. However using this DictEnum resulted in getting the warning i mentioned in the question. How to solve this?
2. what's the difference between BP warning and warnings alone. As this warning is not a BP.