Hello,
I’m trying to pass a DataView to a function within an event via the erp-rest widget.
When I execute the event, it doesn’t appear to call the function as I have a StreamWriter in my function to monitor execution.
My function takes an input parameter, inDS, that is defined as a DataSet.
Here are images from my rest-erp widget configuration:
My DataView’s name is Invoices
I have an API key and ERP Functions library defined in the Call Options section as well.
I do not see this API call in the browser’s network tab when executing either, so I cannot check the payload.
aarong
(Aaron Gulley)
August 9, 2024, 1:58pm
2
Why not use the erp-function
?
Here is an example. I am passing in a dataset for further processing.
Coming back out
The bit i’ve circled in red… This breaks it weirdly… If it’s not a server table which these aren’t.
Snippet inside function code
DataTable dt = inDS.Tables["FuncDS"];
this.OutDS = new DataSet();`
I have a ErrorDS which is a table created on the fly in the function and passed out through OutDS
OutDS.ErrorDS[0].XXX
Signatures
1 Like
When i attempt to use the erp-function widget I am able to see the function being executed, however the dataset is not being passed properly and comes through as null.
The solution to my issue was that I didn’t have my data view in the Dataset Id field
Once I added this, it started working properly.
1 Like
aarong
(Aaron Gulley)
August 9, 2024, 6:04pm
5
Note my response above. If its not a sys table it will break it.
aarong
(Aaron Gulley)
August 9, 2024, 6:04pm
6
Mark solution if youre happy.
Turns out my issue in the end was that I clicked the dataset button which broke my rest-erp widget.
I had to delete the widget and recreate it, then everything started working.
aarong
(Aaron Gulley)
August 13, 2024, 2:45pm
8
Circle back to my initial response in the red circle