Scenario : If the workflow action script is triggering when you create the custom record from the web but not when creating it from the user event script triggered by the creation of a sales order, there may be several reasons why this is happening.
Here are a few possible causes:
Timing issue: When a custom record is created via user event script, it may not be fully processed before the script exits, which can cause issues when trying to trigger the workflow action script. One solution to this issue is to use the nlapiSubmitRecord() function with the doSourcing parameter set to false to ensure that the custom record is fully processed before the script exits.
Permissions issue: The user running the user event script may not have the necessary permissions to trigger the workflow action script. Verify that the user has the necessary permissions to access and run the workflow action script.
Scripting restrictions: Netsuite may have certain scripting restrictions in place that could be preventing the workflow action script from triggering when the custom record is created via the user event script. Check the Netsuite documentation or contact their support team to verify that there are no script restrictions in place that would prevent the workflow action script from executing.
Record ID issue: Ensure that the custom record created via the user event script is properly linked to the sales order. Verify that the ID of the sales order is being passed correctly to the custom record and that the custom record is linked to the sales order.
Workflow configuration issue: Verify that the workflow is set up correctly and that it is configured to trigger on the correct event. Make sure that the action script is set up properly and that it is activated.