10-Add Custom Epicor Database Tables To Screens - GingerHelp
10-Add Custom Epicor Database Tables To Screens - GingerHelp
A D D I N G C U STO M TA B L E S
TO A S C R E E N I N E P I C O R
ADAM ELLIS · JULY 2, 2020
One of my more frequently visited articles is on how you can add custom
field to EpiDataViews and it occurred to me that perhaps some of you out
there might be looking for ways to incorporate entirely custom Epicor
database tables as well. The Epicor architecture allows us to define
brand new EpiDataViews on a screen and then use them just like any
other view. What’s more, you can even define parent / child relationships
on these EpiDataViews that you create to build very complex screens.
Let’s start with the easiest scenario, adding one of the UD tables to your
screen. This scenario is easy because Epicor gives us a wizard that
writes all of the code for us. Before you start the wizard, though, you will
want to think out how your tables are going to relate. Keep in mind that
the UD tables have 5 key fields (key1, key2, key3, key4, and key5) - you
don’t need to use all of them but the UD module will enforce uniqueness.
So let’s say, for example, you want to add your own DIY “configurator” to
order entry and you are going to do so by attaching a UD table to the line
- your key map might look something like this:
And from there you are going to store the attribute value into Number01.
So the actual data in the UD table might be expected to look something
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 1/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
like this:
Next select the ‘Add User Defined Table As Child’ wizard and press
‘Launch Wizard’:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 2/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
On the first step you need to specify which data view you are linking on
and which UD adapter we wish to connect. Recall in this example we are
linking at the line level (OrderDtl) for our DIY configurator and lets say we
are storing our data in UD03:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 3/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
Click next and now we will need to define how the fields in OrderDtl tie
up to the selected UD table. To make these connections simply pick the
value from the ‘Fields’ drop down for your source table (OrderDtl) and 'UD
Key Fields’ for the destination table (UD03):
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 4/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
A careful observer here might notice that only keys 1-4 are available for
selection. Another thing that this wizard does for us is configure key5 to
be an automatic auto-incrementing number so entries are guaranteed to
be unique (if you don’t like that behavior you can edit the resulting code
of this wizard). Note here that we are only telling the wizard the values for
key1 and key2 here - that is because there is a one-to-many relationship
we are looking for (a given order line could have multiple attribute rows).
Click finish and navigate to the script editor to see what has been written
for you:
You don’t really need to do anything with the code at this moment but we
will need to save our customization, get out, and then back in before we
can do much with it since so much of the work is done on initialization.
But upon reloading this customization we will find that our newly bound
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 5/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
…or interact with it just like any other EpiDataView. Whats more, Epicor
has even added for us a ‘New’ menu option to create new entries within
this table:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 6/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
If you want to change the text of that menu entry, simply tweak it at line
122 of the code that was generated for you (or you can flip ‘Add Enabled’
to false if you don’t want the menu at all):
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 7/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
All pretty simple so far, right? Well how about if the table you want to add
isn’t a UD table? Fortunately we can look to the auto-generated code
here to learn how to create our own custom setup. I am not going to spell
out every possible option here, but in general here are the steps:
Define your table, EpiDataView, and anything else you might need at the
top of the script where Epicor has “// Add Custom Module Level Variables
Here **”:
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 8/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 9/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
And thats it - from here you might go about filling the data table from a
BAQ but it is ready at this point to bind to grids or interact with like you
would any other EpiDataView. Hope this helps somebody out there
looking at add Epicor database tables into a custom screen! Let us know
in the comments below…
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 10/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
Hi.
Good article.
In my case isn't work, when I click on "New UD36" it didn't anything.
I restarted my session, I've binding the textbox and epiUltraGrid but looks like I didn't
anything yet.
Do you have any idea?
Thanks!
PREVIOUS
NEXT
LET’S CHAT!
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 11/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
CONTACT US
GingerHelp is an
independent consulting
practice with no direct
affiliation with Epicor® or
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 12/13
5/16/24, 3:46 PM Add Custom Epicor Database Tables to Screens — GingerHelp
Infor®.
© 2019 - 2023 GingerHelp,
LLC
Epicor®, Vantage®, and
Prophet 21™ are registered Terms & Conditions |
trademarks of Epicor Privacy Policy
Software Corporation®.
Infor® and VIUSAL® are
registered trademarks of
Infor®.
Crystal Reports® is a
registered trademark of SAP
AG.
https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-custom-tables-to-epicor-screen 13/13