Having trouble passing DataView to function via erp-rest widget in event

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:
image

My DataView’s name is Invoices
image

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.

Why not use the erp-function?

Here is an example. I am passing in a dataset for further processing.

Coming back out

image

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

image

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

image

Once I added this, it started working properly.

1 Like

Note my response above. If its not a sys table it will break it. :tipping_hand_man:t3:

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.

image

I had to delete the widget and recreate it, then everything started working.

Circle back to my initial response in the red circle :slight_smile: