Display Method using Enum

I am trying to use a display method to show the description on a report of an enum I thought that it would simply be:

display str dspType()

{

if ProdJournalRoute.ScrapType::All

return “All”;

if ProdJournalRoute.ScrapType::a

return “A”;

}

I keep getting a syntax error. Does anyone have any suggestions?

Your conditions should be like:

if (ProdJournalRoute.ScrapType == ScrapType::All)

Can’t you just return the enum type and let the system use the labels?

One more thing, you shouldn’t have hard coded texts on code, return labels instead.