I’m in the process of creating/uplifting a classic WinForms dashboard to Kinetic Application Studio and I’m trying to replicate a fairly involved button click workflow.
On button click, the logic does the following:
Reads selected rows from a grid (Pack Slips)
Builds a *-delimited string of ShipHead.PackNum
Calls a Published Epicor Function via REST:
Library: MasterPackAutomation
Function: ProcessPackSlips
Input: packIds (string)
The function returns two outputs:
masterPacks (string)
packErrors (string)
Based on the response:
Show error message if packErrors has data
Show success message if masterPacks has data
This is currently working fine using Client.
Now, I want to implement the same behavior in Application Studio, specifically:
Collect selected grid rows
Loop through them to build a single input value
Call this Epicor Function
Capture return parameters
Where I’m stuck / need guidance
Best practice for looping selected rows and building an input parameter with ‘*’
Correct way to map multiple function return values in Application Studio
So far, I have button which is calling the function,currently, I am testing with only one value and based on that I also did the trace which return null.
I’ve got a similar for a Dashboard that reads/writes to UD10. This is the Save flow that sends the row data to the function for processing, gets a response and depending on what’s returned the Condition will display the returned error message or refresh the grid.
If @Randy’s solution doesn’t quite work (though I have no doubts it will), this thread where him, @dcamlin, and I worked through something similar (in reverse of building the delimited list) might also provide some useful insights:
I have used both approach and had got me started. Big thanks to @Randy , @d_inman , @dcamlin !Thank you for your help!
I was able to build delimited and pass it to my function. I want to handle the response and show it under MessageBox. I tried using OnSuccess after function run to show {actionResult.masterPacks} and it shows up fine.
And same on OnError after function run to show {actionResult.packErrors}. Is this the correct approach?