Converting enum values to string in Dynamics Ax views
Here is the code snippet for converting enum value to string with the help of my colleague Danish
public static server str genderString()
{
tableName viewName = identifierStr(HcmWorkerInfoView_TYL);
DictEnum dictEnum = new DictEnum(enumNum(HcmPersonGender));
Map enumValues = new Map(Types::String, Types::String);
int n;
for (n = 0; n < dictEnum.values(); n++)
{
enumValues.insert(int2str(dictEnum.index2Value(n)), SysComputedColumn::returnLiteral(dictEnum.index2Symbol(n)));
}
return SysComputedColumn::switch( SysComputedColumn::returnField( viewName, identifierStr(PrivateDetais), fieldStr(HcmPersonPrivateDetails, Gender)), enumValues, SysComputedColumn::returnLiteral(dictEnum.index2Symbol(n)));
}

This was originally posted here.
*This post is locked for comments