For example, we have a client who organizes sales regions into sales districts. So, on the Sales Region Maintenance screen, we want the user to be able to select a district.
BEFORE
AFTER
You can customize the form, by adding a TextBox for SalesRegion.Character01 field, but it is better to have the user select from a range of choices.
Previously to accomplish this, you would have to add the sales districts into a user-defined table, and then add a combo box which populates from that table.
The easier way is to use something called User Defined Codes Maintenance.
Step 1 - Define User Codes
Located under System Management -> Utilities -> User Codes, open the "User Defined Codes Maintenance screen".
Create a Code Type, and then assign values (Code, and Code Description). In my case, I created a Code Type called "District", and added 4 codes, with descriptions "Northern District", "Southern District", etc. Each code also has a shorter Code ID.
Step 2 - Associate Field with User Code
Located under System Management -> Utilities -> Extended Properties, open the Extended Properties Maintenance screen.
In my case, I want to associate the district codes with the sales region:
- Selected "Region" DataSet Table ID
- Selected Fields tab, and selected the Character01 field from the tree view
- for the UD Code Type: field, chose "District" from combo box.
Now the system knows that Region.Character01 is associated with User Defined Codes "District".
Step 3 - Form Customization
Now I need to add to the Sales Region form a combo box for the Character01 field.
- Turn on Developer Mode (Main Menu -> Options -> Developer MOde)
- Open Sales Region
- Start Customization (Tools -> Customization)
- From Toolbox, add a EpiCombo control to the form
- Change the EpiBinding property to Region.Character01
As soon as I select Region.Character01 for the EpiBinding property, the system automatically filled in for me the EpiCombo properties.
And that's it. Now your users can choose from a pre-defined list of values for a user defined field.
I was following this guide and everything was fine until Step 3. Searching EpicWeb, found this extra tip to make it work:
ReplyDeleteIf you experience issues with the combo box not populating correctly and are running Epicor 9 on a SQL server then try the following. Be sure that you have created the User Defined Codes, added the Extended Property, exited Epicor 9 and are adding the combo as a "new" control to the form. If it still does work then try restarting the app server and then add a new combo box to your customization.
Just wanted to say thanks for writing this up! I was creating the combo box first and then doing the rest and Epicor was not linking it up at all.
ReplyDeleteIs it possible to allow users to update this list in the form itself?
ReplyDeleteThe epicombo list can be updated at anytime by using the right click -> Refresh list option.
ReplyDeleteIs it possible to access the udcode's id or code in the customized screen, but view the description in the drop down?
ReplyDeleteFor example choosing say 'eastern region' from the combobox, then populate a textfield in the screen with the codes id, ie 1?
something like epicombobox1.value?
this post has resulted very useful for me
ReplyDeletegreetings from mexico
this post has resulted very useful for me
ReplyDeletegreetings from mexico
This comment has been removed by the author.
ReplyDelete