The following error is thrown when triggering a Workflow Action Script.
Notice:
â– Invalid return type for custom action
Solution
Above error is returned when the Workflow Action has a value selected under Parameters> Store Results In but does not have a return value inside the Workflow Action script.
Sample:
function workflowAction() {
var recordnumber = nlapiGetRecordId();
//Commenting out below line will cause the error.
//return recordnumber;
}
Store Result In = Freeform Text Field (State) (Type = Free-Form Text)
To avoid the error, make sure that a return line is added and it matches the field Type of the field under Store Results In.