Binding an Epicor ERP Combo Box Available Values to User Codes
A frequent request I get is to add a combo box to an Epicor ERP screen bound to a UD field in order to restrict what users can input into that field. A real-world example from a past project - a UD field added to the sales order line that requires the selection of a ‘No Charge’ reason for lines sold at $0. There are actually 4 different available combo box widgets available to you in the Epicor customization dialog:
EpiUltraCombo: This is the easy one - you just bind your UD field to the widget here and fill in the available choices using the ListItems property. The downside to this one is that if the available choices ever need to change, you need to get into the customization to change it. Not ideal for entries to be maintained by end users.
EpiCombo: This is the one we are going to focus on for this article. The EpiCombo pulls its available values against Epicor business objects.
BAQCombo: Pulls its available values from a BAQ.
EpiRetrieverCombo: This one acts as a wizard helping you to build out all of the right settings for an EpiCombo. If you are pulling from a master file like parts, customers, etc this will probably be your best choice. The end result is also very similar to an EpiCombo so you can review the properties and learn how you could have done it by hand.
To bind against user codes, we definitely need the power and flexibility of the EpiCombo. Let’s start with the setup of our user code. Start by setting up the user code type:
Now go to the ‘Codes’ tab and add in all of the values you wish to be available within your combo box. The code field will end up being the value and description will be what is displayed in the combo box to represent that value. For example, if I was using this combo box for a UD field on OrderDtl called OrderDtl.MyCustomField_c the value stored in the database when I pick ‘Value #2’ from the combo box will say ‘VAL2’.
Now we can configure our combo box. When you add your EpiCombo to the canvas you will want to do all of the things you normally would (give it a proper name, bind it, set up an associated label) but then also fill out the following properties:
Of specific note:
The EpiBOName is the first property you select - picking Ice:BO:UserCodes from nearly the bottom of the list.
EpiDataSetMode needs to get flipped to ‘RowDataSet’. The default setting (ListDataSet) only returns the UD Code types whereas RowsDataSet lets us pick from the UD code values.
In the SearchFilter we are telling it specifically which Code Type ID we are looking at.
And that should be it. Close out of your customization and get back in to see the combo box properly showing only the values defined in UD Codes. This approach works for various other business objects such as UD tables as well.