Dataview as a function parameter

Hi guys.
I am trying to pass dataview with some data as a function parameter.
On BE I have the next function signature:

and on FE I have the next params:



JobMtlSelected - is a dataview, which contains 2 columns and a lot of rows. However, in the network, when request is made, I see that payload contains only empty object:

I assume I need to fill in some dataset model:

, because it seems the empty object is taken here, but what should I put there? It seems to be a plain json object w/o any binding

Could someone help me out

PS I googled that some people used rest-erp widget to call function, but I am not sure such approach actually works

Try this post

2 Likes

thanks, this solution seems to be working, but I am curious if there is the way to make the function work.
With rest erp widget I had to move some input parameters to the dataset, bc it appears that’s the only parameter type available, and I can’t add int or string params:

Here is an example,

Create the function library added the ABC code service.

In the signature change the input parameter type to “select type” a dialog appears and you can then select the relevant tableset from the services tablesets list

In my really simple example I just added a message widget to show the abccode of the current record.

I made a modification to the abccode details form with a button and an onclick event to call the function



in the method parameters I added the ABCCode dataset which you can get the dataset id from the DataViews item

on doing a preview I get

Things to note.

  • You need a valid api key
  • You need to promote your function library.

I hope that helps.

3 Likes