Application Studio - Row-Update from Function output

I’ve been working on a customization with success up until the final point - updating a custom field with the output variable of a function. The function itself works correctly and outputs the results we expect, but loading the output variable into a row-update value fails when testing. The custom event is as follows - A button click triggers a kinetic-function widget, and a response parameter is returned: “opNumApprovers”. After this, a row-update widget is called to update the custom integer field “NumOfApprovers_c”. I’ve entered “{actionResult.opNumApprovers}” into the value property, although it fails most likely because it’s being treated as a string. From the user’s perspective, nothing happens or changes. What would be the correct way to update the field?
I am on Kinetic version 2025.1.5 using the client on Windows 11.

Welcome, Miles!

Have you tried entering {actionResult.opNumApprovers} - without quotes?
I don’t usually put anything in the Value field, instead I use the Expression field – I’m really not sure what the difference is…

1 Like

What you have looks like what I have used in the past.

I use this for barcode scanning on production activity. It updates Job/Assy/OprSeq all in a row.

Maybe double check that you are using the correct name of the output you defined in your function?

The difference here might be that JobNum is a string.

Most times, that doesn’t matter - but sometimes there are built-in type-checks…

When you use the wrong name, it will try to put the {actionResult.opNumApprover} string in … which is obviously not a number and won’t work…

Are you debugging with the browser’s developer tools? Look in the network tab for calls to your function and check the response data. Look for the events happening in the console (use Ctrl+Alt+8 to turn on debug logging) and see what value it’s trying to set your NumOfApprovers_c field to

I am doing the same thing for LaborDtl.AssemblySeq and LaborDtl.OprSeq which are Int32, but it is entirely possible I dumb lucked into something that worked.

1 Like

I’ve tried this with no success. It fails to save anything after clicking “save” in the JSON editor - unless it either is contained in quotes or is a constant number. I’ve also tried entering {actionResult.opNumApprovers} into the expression property - no success. I’ve double-checked the return variable’s name and it is correct. This is what I’m getting as a response (the opApprover null values are intended):

With @justint 's comments, I’m certain that it’s not a string vs int issue - and using the Value field appears to be totally correct. You’ve shown that your response data is named as expected.

Could you show the actions of the event running? In the console, with debug logging turned on - the event actions will display as they happen.
Also, check the dataview contents after: Ctrl+Alt+v will spit out all the current values of the dataviews - actionResult is under System Dataviews, and check the value of POHeader.NumOfApprovers_c

Hey Jonathan, this is what I’m able to find:

And here are the event’s actions:

1 Like

Actually, it started working all of a sudden. Last time I tested it, I set the value back to “{actionResult.opNumApprovers}”, removed the expression, ran it, and it failed again. No changes have been made but now it successfully updates the field. Strange.

1 Like

Welcome to the wonderful world of Epicor! After making a change, sometimes you have to close everything, and reopen it before it actually works - up to and including logging out and logging back in.

It’s all the fun stuff they don’t tell you about, until walking you through demos and training sessions at Insights.