How to Create a Revenue Arrangement in SuiteScript 2.1
We want to create Revenue Arrangements in script. The script errors out on the .save() operation. Without options it throws a permissions error:
“name”:”INSUFFICIENT_PERMISSION”,
“message”:”You do not have permission to perform this operation.”
With options like
var revArrangementId = revArrangement.save({ enableSourcing: true, ignoreMandatoryFields: true });
it instead throws a user error:
“name”:”USER_ERROR”,
“message”:”Please enter value(s) for: Revenue Element”
Of course, we are populating (we think) the Revenue Element lines and committing them.
What are we missing?
Thanks in advance for any insight.
It seems the issue you’re encountering could be related to permissions and missing mandatory fields in your script. To resolve the “INSUFFICIENT_PERMISSION” error, ensure that the script is running under a role with the necessary permissions to create and save Revenue Arrangements. You may need to update the role or permissions in your SuiteScript settings.
For the “USER_ERROR” regarding missing “Revenue Element” values, double-check that you’re correctly populating all required fields before saving, especially for each Revenue Element. You may also want to validate your Revenue Element data using log.debug statements to ensure it is being correctly committed.
For expert guidance or more detailed assistance with SuiteScript 2.1 development, you can contact Codinix Technologies. They specialize in NetSuite customizations and scripting solutions. Reach out to Codinix for further help in troubleshooting your script.
In which script type are you creating Revenue Arrangement record? And what is the execute role for that script. You have to check that script type and role and confirm that has permission to Revenue Arrangement record.
We are running the script as Admin. We have also looked at all of the editable fields , comparing our code against system generated RAs. No luck.
We have for the moment abandoned the attempt to create a Revenue Arrangement in script – even though NetSuite documentation says it can be done. Instead, we are letting NetSuite generate the Revenue Arrangement, then editing the Revenue Elements to suit our needs.



