Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Epicor Kinetic Customization - Add Columns To Screens - GingerHelp

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

 support@gingerhelp.com

A D D I N G N E W C O LU M N S TO
E X I ST I N G E P I C O R K I N E T I C
SCREENS
ADAM ELLIS · SEPTEMBER 3, 2021

TOPICS: EPICOR KINETIC CUSTOMIZATIONS /


APPLICATION STUDIO

A frequent request that we will get is to add a new column to an existing


data grid or screen within Epicor Kinetic. A recent example was the
request to add the customer name to the time-phased inquiry for any
sales order rows. Over the years we have taken a variety of approaches
to meet this sort of requirement:

• There is the brute force approach, where we have used code within
classic forms customizations to dynamically add a column on form
load and then maintain it via lifecycle events.

• There is the sneaky approach, where we take an existing unused


column in the grid (hopefully there is one), relabel it, and change the
data contents via a post-processing directive.

• Or there is the painful approach, where we fully recreate the grid


bound to a new EpiDataView holding our new columns alongside
the original data.

Of course, the Kinetic migration really has thrown a wrench in the


customization-layer heavy approaches. For my latest project, I decided to
do this the “new” way and I am pleased with the results. This article ends

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 1/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

up mashing up several different concepts from Functions (which I don’t


yet have any articles about) to Kinetic Application Studio (read the intro
here first if this is new to you).

BUILDING THE DATA


OBJECT
So let’s start by building out the data object we will be working with here.
We could have possibly just went straight into a custom BAQ here, but the
time phase is pretty complicated so I opted to try to just build on top of it.
To do so, I created a Kinetic Function library per the following:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 2/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Now for the actual code of the function itself. The code within functions is
pretty similar to what you would be used to developing regular BPMs.
The biggest difference will the the CallService method calls you see in
here - this is a wrapper that just makes it a little easier to call and properly
dispose of business objects within your code. So here is the actual code:

this.CallService<TimePhasSvcContract>(timePhas => {
// Call the standard time phase BO
TimePhasTableset timePhasTs = timePhas.GoProcessTimePhas
this.partNum,
0,
this.callContextClient.CurrentPlant,
true,
true,
true,
""
);

// Convert to a DataSet so we can do whatever we want t


DataSet ds = DatasetAdapter.ConvertToGenericDataset(tim

// Add a column for the customer name


ds.Tables[0].Columns.Add("CustomerName", typeof(string)

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 3/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

// Now fill that customer name when this is a sales ord


foreach(DataRow dr in ds.Tables[0].Rows) {
// Only worry about it if the OrderNum column isn't bl
if (!string.IsNullOrEmpty(dr["OrderNum"].ToString()))
// Use the SalesOrder BO to do a GetList to locate t
this.CallService<SalesOrderSvcContract>(so => {
bool morePages;
OrderHedListTableset oh = so.GetList("OrderNum = "

if (oh.OrderHedList.Count() > 0) {
dr["CustomerName"] = oh.OrderHedList[0].Customer
}
});
}
}

// Finally fill our variable with the results


this.output = ds;
}
);

As you can see with the comments added in, we are using the Time
Phase BO to first generate a time phase for us, then we convert the
resulting typed tableset to a generic dataset, add a new column for
CustomerName, and then fill it by looking up the sales order and pulling
the customer name from there. Last step is to assign the ‘output’
parameter to the dataset we just built. Once your code is in place,
promote your function library to production so we can see it from Kinetic.

CREATE AN API KEY


https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 4/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

The next step will be to create an API key using API Key Maintenance /
Access Scope Maintenance. You will want to be certain to authorize this
new library for use with this key.

ADDING TO THE KINETIC


APPLICATION
At this point, you could call this function from anywhere and utilize its
output, but since we are trying to live in the “new” here I am going to
focus on adding this to the Kinetic Time Phase app. Start by loading up
Time Phase in Application Studio (again, if this is new to you please check
out this article) and creating a new layer. Within Application Studio we first
want to create a brand new view for our new Time Phase grid that adds
the customer name:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 5/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Now go to Events and locate the one named ColumnChanged_PartNum.


Just as with classic forms, there are events that can be added to fire as a
column is changing and after a column has changed. This app already
had an event defined so I am just adding to that existing event but you
also could have created this event from scratch using this same sort of
triggering:

But since we are just adding to an existing event here, we can simply add
our function by dragging ‘erp-function’ from the toolbox onto the canvas:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 6/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Click on the newly added erp-function object and fill in the


following on the properties panel for it:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 7/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Now click on Method Parameters and define how our partNum


parameter gets populated when we call this function. Here I am
telling it to use KeyFields.PartNum, which I determined was an
appropriate value by examining the properties of the trigger at
the beginning of this event workflow.

Now go get out of this Method Parameters drill down (by clicking
the ‘erp-function’ breadcrumb at the top of this properties panel)
and drill into response parameters. Here we are determining
what to do with the results that come out of our function. In our
case, we know that we are expecting a response in the form of a
dataset that we’d like to point to that new TimePhaseCustomer
data view we just created. Start by pressing the + button and
then fill in per the following:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 8/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Going down the list, here is what each property is doing:

• Parameter Path: This is the name of the output parameter


we defined within our function.

• Parameter Name: This would be the name of the table


within the dataset returned by our function that we wish to
point our view to. We didn’t explicitly define this in our
function, but recall that we simply piggy-backed off the
standard Time Phase BO and this is the name of the table
returned by that call.

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 9/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

• View Name: This is the new view we defined a few steps


back in Application Studio.

• Parse from Response Path: To be honest, I am not quite


sure of the scenario here where this would differ from
Parameter Path but I am sure I will encounter it.

• Merge Behavior: Here we decide whether the resulting


rows get merged with what is in our new view or it just
replaces the rows in there. We want to replace so that the
contents are cleared out with each part change.

So at this point we actually have the plumbing all in place - now it


is just a matter of putting it on the screen. To do so, go to
Application Map and edit the Activity page:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 10/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

In the designer, we want to drag a Panel Grid from the toolbox


onto the canvas. Panel Grid is a widget that combines a data
grid with the tools to collapse/expand and go full screen - you
will be using it a lot in Kinetic:

With the Panel Card Grid added, go to it’s properties and expand
out the ‘Data’ section and click on Grid Model:

Then simply fill in the name of the view we defined earlier


(TimePhaseCustomer) for the Ep Binding:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 11/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Now we are ready to test this out. Hit the save button in the
upper corner to save our layer changes and then use the
preview button to test it out. Pick a part and see the results:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 12/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Yikes! Ok, that is a lot of columns. At least we know it is doing


something but we see here that the default behavior of a Panel
Card Grid bound to a view is to show all defined columns. To
button that up we are going to need to go back to the properties
for the Panel Card Grid and drill into Data / Grid Model / Columns.
From here we need to spell out exactly which columns we want
by pressing the Add button, filling in the column name, and
repeating over and over for each column you wish to add. Be
mindful of the order you enter these in as that is the order they
will display and it is not easy to change (currently):

Once you get all of the columns you want added, return to
preview and we will now see a much nicer output:

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 13/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

The remaining cleanup from here was just to add the rest of the
columns I wanted, apply the appropriate ‘ERP Editor’ and ‘ERP
Editor Model’ properties to control how the columns are
displayed, and remove the standard Time Phase grid from the
screen.

AUTHOR: Adam
Ellis
Adam Ellis is the owner of
GingerHelp. Adam is a lifelong
entrepreneur and has extensive ERP
and mobile software knowledge
through his consulting and
management experience. He has a
passion for exploring innovative ideas
and how they can change the status
quo. Connect with Adam on LinkedIn
to learn more about his involvement
in the ERP space.

FACEBOOK TWI TTER PINTEREST 3 LIKES

COMMENTS (3) Newest First

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 14/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Preview POST COMMENT…

Paweł Malicki 3 weeks ago · 0 Likes

Great tutor!
However you don't really need to put an API key inside erp-function object when your
function is in the same environment.

Mukesh Desai 2 years ago · 0 Likes

Finally , I have made this working in Demo database. Use following reference in using
statement to pass error message - Erp.Tablesets;

Appreciated the detailed walkthrough for deep diving Kinetic. Hope to have some
more in near future. I am investigating better ways to display rest service, function or
baq response values on the kinetic control {not the gird} like text box, label.... Is there
a way to use formula / calculated values to be display on client side. How?

Thanks for a very good detailed article. This help us to better understand the
mechanics of kinetic customizations.

Mukesh Desai 2 years ago · 0 Likes

Easy to follow steps. However I am getting this error at saving BPM Functions. I have
already added Ref > Assemblies for SalesOrder and TimePhas.

There is at least one compilation error.


getTimePhase.cs(6,21): error CS0234: The type or namespace name 'BO' does not
exist in the namespace 'Erp.Contracts' (are you missing an assembly reference?)
getTimePhase.cs(7,21): error CS0234: The type or namespace name 'BO' does not
exist in the namespace 'Erp.Contracts' (are you missing an assembly reference?)
getTimePhase.cs(26,30): error CS0246: The type or namespace name
'TimePhasSvcContract' could not be found (are you missing a using directive or an

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 15/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

assembly reference?)
getTimePhase.cs(28,15): error CS0246: The type or namespace name
'TimePhasTableset' could not be found (are you missing a using directive or an
assembly reference?)
getTimePhase.cs(49,36): error CS0246: The type or namespace name
'SalesOrderSvcContract' could not be found (are you missing a using directive or an
assembly reference?)
getTimePhase.cs(51,21): error CS0246: The type or namespace name
'OrderHedListTableset' could not be found (are you missing a using directive or an
assembly reference?)Appreciated your thoughts? Thanks.

NEXT

AN INTRO TO EPICOR KINETIC CUSTOMIZATIONS FOR


DEVELOPERS
EPICOR ERP, EPICOR CUSTOMIZATION

LET’S CHAT!

CONTACT US

GINGERHELP, SERVIC PRODU KNOWLEDGE


LLC ES CTS BASE

8685 Fox Epicor ERP Epicor ERP Epicor ERP Articles


Lake Road Consulting Extensions Infor VISUAL Articles

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 16/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

Sterling, OH P21 ERP Infor Dynamics 365


44276 USA Consulting VISUAL ERP Articles
Infor Extensions Crystal Reports
 VISUAL ERP Articles
support@gingerhelp.com Consulting SSRS Articles
Dynamics Bezlio for Mobile
365 ERP Articles
Consulting
SSRS
Developer
Services
Crystal
Reports
Consulting

GingerHelp is an
independent consulting
practice with no direct
© 2019 - 2023 GingerHelp,
affiliation with Epicor® or
LLC
Infor®.

Terms & Conditions |


Epicor®, Vantage®, and Privacy Policy
Prophet 21™ are registered
trademarks of Epicor
Software Corporation®.
Infor® and VIUSAL® are
registered trademarks of
Infor®.
Crystal Reports® is a

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 17/18
5/16/24, 3:15 PM Epicor Kinetic Customization - Add Columns To Screens — GingerHelp

registered trademark of SAP


AG.

https://www.gingerhelp.com/knowledgebase-epicor-erp/adding-columns-to-existing-screens 18/18

You might also like