ERP-Function Output & Parameters

Hello, new friends.

Our Estimating department is requesting several tools be built to assist them with getting quotes out more quickly. The first of these tools is a “Current Job Cost Analysis”, designed to create a hypothetical run of a job for a given part, using historical data for material usage and runtimes, but current data for material price, equipment and labor burden rates, and goal margins. Our initial goal for this is to be able to look at a given historical job (and associated quote) to determine if it’d be profitable if we scheduled it today. Down the line, we’d like to be able to automatically run a report against a larger list of parts, but this is more complicated than the single-job case, as some user input is going to be required for material and outside-process RFQs. Eventually, we’d like to be able to create a quote directly into Kinetic out of the results, but we’re taking baby steps. Unfortunately, our IT department is small (with me joining recently that makes 2 of us) and neither of us is very comfortable yet with developing for Kinetic, or with the REST paradigm in general. We’re still in the exploratory phase of figuring out what’s possible vs what’s achievable.

I’ve been fiddling with AppStudio, writing some basic functions to run calculations with an input table from a grid. I’m running into a brick wall trying to parse out my response parameters.

The App! Does it do anything useful? Not at all!

The two textboxes should be a sum of columns 1 and 2 when you click Run eFX.

Here’s the function in question:


the ERP-function widget calling it is set up as shown:



When called, I get a useless correlation error, and a couple events in my Console.

The toast message before is showing Col1 and Col2 from ViewGrid1, and the toast message afterwards should be showing actionResult.output1 and .output2, which isn’t happening.

I’m sure I’m missing something simple and obvious here, I’m pretty far outside of my usual scope. Unfortunately, the Kinetic reference guide entries for these fields are basically just what the tooltip says, so I’m reaching out to the experts. I’ve tried searching for several different permutations of what I’m trying to learn, but I haven’t found anything. I don’t need this specific function to work, but I do need to understand in the general sense what’s going on with function parameter return.

You’re all beautiful people.
Thanks in advance for helping me wrap my head around what’s going on here!

That Correlation ID will (should) correspond with an entry in the Epicor App Server log … the error message there should help you in the right direction toward debugging your function.

Have you been introduced to the RestHelp for Kinetic?
Replace Apps/ERP/Home/#/[blah-blah-blah] in your Kinetic URL with apps/resthelp/#, then navigate to the Epicor Functions to test your functions in isolation … but error messages still come back with just a correlation ID, and you’ll have to generate an API key…