I’ve been poking around the Application studio in an effort to gauge pain points on a full upgrade to the Kinetic interface. When trying a function out in Application studio I got stuck because I couldn’t pull the results into the fields on the form.
On a whim, I put a message box on the function widget for the “OnError” and it was triggered. The API call resulted in the following message in the debugger:
Looking at the call itself, it returned the expected data from the API. I’m just unsure why it is hitting the OnError path instead of the OnSuccess path. If I do the row-update logic on the Error side, it fills in the form just like I wanted.
Which brings up a second question. If I have the results coming back from the function, is there any way to assign the opposite value of a Boolean result to a view? Something like:
"!{actionResult.hasErrors}"
EDIT: Turns out, that’s exactly what I need to put in…
The issue I have is the erp-function call is not being shown as a Success. It’s following the Fail route. That’s what I cannot figure out. I’ve got the return (on the OnError path) data going to their fields.
This is the only thing I’ve got that stands out. I didn’t define any response parameters defined for the function because I’m not tying to any dataset/dataview and wasn’t sure what to fill in for that.
What’s the JSON response look like for your Efx call?
You may need to put a value in the “Parse from Response Path”.
I suspect that because it defaults to returnObj, it’s trying to find that since you didn’t enter anything different and throwing null because your JSON probably is something else.
You could just negate doing the success/error branch (remove them) then drag row-update onto the editor and link them. You should then be able to use actionResult.success or actionResult.message.
Hmm, I don’t think so, because I do all of my testing in 2022; I’ll check, though!
The easiest way would be to set the results to a view.
Set the response params to the following:
Parameter Name: results
View Name: whatever your view is called
Parse from Response Path: returnObj
I don’t know if it’s less work, but it does give you some debugging options as well as future use of the returned fields. If you do something else the uses actionResults, the previous information will be lost. If you save it to a view, it’s yours to use until you call that function or modify the view on your own.
If you’re returning the function data into a view, you can then do a row-update to do both of the scenarios you mentioned.
Let’s say you created a view called EFX with two fields: success and message.
Using row-update to update another view (let’s say TransView), you would set the epBinding to TransView.YourField and the value to “{EFX.message}”.
Using row-update to update the same view is pretty much the same. Set the epBinding to EFX.message and the value to “Your updated message”.