Epicor Functions with Response Parameters Failing when Scheduled, but Succeed through API

I have a function that works fine if I run it through the API:

It has a couple of request parameters and a couple of response parameters.

When I try to schedule the function, it asks me to fill in the parameters (including the response parameters) but when it tries to run it errors out. This occurs whether I leave the response parameters empty or give them a dummy value on the scheduling form.

However, if I remove the response parameters from the function it is successful in running.

Can scheduled functions just not have response parameters, am I missing a step, or is this a bug?

What is the datatype of output

Try renaming the response parameter to returnObj datatype: string

Then in your code if it’s c#

Add the following

string returnObj = ""; //Initalise the variable. :D

try
{
    // Your code here (place your code within the try block)
}
catch (Exception ex)
{
    returnObj = ex.Message; // Assign the exception message to returnObj
}

It’s a bug. And it’s likely in the way the function was saved. You may have to recreate it.

Make a new simple test one and check.

Is there any workaround / solution / official Epicor statement on this? I hit the same issue recently.

Hi. There is a workaround. Only if you don’t care about the output results.

Regards

There is usually no need for a workaround.

Export your function library. Reimport with force option.

Will most likely work properly after that.