I’m a little confused about how function return parameters are handled syntactically.
My specific example is: I need to call a function (from C# Custom code) that has two return parameters:
- output which is type Int32
- prodCalDataSet which is type Erp.Tablesets.ProdCal.Tableset
The following is boilerplate code I have used with other function calls:
It’s not clear to me how to deal with this “AnonymousResult” and get the prodCalDataSet from the result of calling the function.
I did manage to figure out that if I use GetJsonResult (see commented out code), I can get two tokens one for the output and one for the prodCalResult, can I convert the Json token easily into a dataset then ?
I see you are doing all of this inside of Epicor so I doubt this is going to help, but @josecgomez made some type of dynamic object in his rest helper. Not sure if there is some equivalent we can tap into inside of Epicor.
Instead of returning the Prodcal tableset, return a string by serializing the Prodcal tableset then you can deserialize it to dynamic (or Prodcal tableset again)
var localResult = stringResponse.GetAnonymousResult( new { prodCalDT = (Erp.BO.ProdCalDataSet)null} );
Erp.BO.ProdCalDataSet prodCalDT = localResult.prodCalDT; //You could just use the localResult.prodCalDT here as your object here as well
//or
Erp.BO.ProdCalDataSet prodCalDT = stringResponse.GetAnonymousResult( new { prodCalDT = (Erp.BO.ProdCalDataSet)null} ).prodCalDT;