How to deal with enums in Electronic Reporting ?

Enum fields cannot be exported as it is in Electronic reporting. We need to use a workaround that is detailed in that post. 

In our case I would like to export the item type stored on a purchase order line.  

In the Model mapping designer, select Enumeration and click Add root 

Type in a Name 

Select the enum in the Enumeration drop down field 

In our case the enum is ItemType

Click OK

In the Data model section, select the node and click Edit 

We need to use the CASE function. 

Select the data method getItemType() in the PurchLine table to retrieve the item type field. 

Then, for each enum value, type in the value you want to display in your report. 

The formula is: 

CASE(@.’purchLine()’.’getItemType()’,

Po_Line_Type.Item, “Stock”,

Po_Line_Type.Service, “Service”)

That’s it you can now export enum fields in Electronic Reporting ! 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: