Kinetic Function ends on function call

This line
InvoiceService.GetNewAPInvDtlMiscellaneous(ref apInvTS, nVendorNum, strInvoiceNum);

is killing my kinetic function. Not sure why. Have any of you seen this before? Variable declarations are below followed by the line again as it resides in my function.

var InvoiceService = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.APInvoiceSvcContract>(context);

InvoiceService = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.APInvoiceSvcContract>(context);
var apInvTS = new Erp.Tablesets.APInvoiceTableset();
string strInvoiceNum = 6455903790;
int nVendorNum = 221067;

InvoiceService.GetNewAPInvDtlMiscellaneous(ref apInvTS, nVendorNum, strInvoiceNum);

Couple things:

  1. I’m not seeing a Type Declaration for InvoiceService. Was that left out?
  2. It looks like your string strInvoiceNum is actually an int (no β€œquotes”).

Is your compiler not giving you errors?

Also, try to not create your own context in functions, unless absolutely necessary.
Use CallService.

4 Likes

I added it up above. Forgot to include it when I created the topic.