When working with Scriptable Cart and custom records, resolving permission errors requires careful consideration of both the custom records and the script logic. Follow the guidelines below to address any permission issues you may encounter:
- Custom Record Setup:
- Ensure that the “Use Permissions” box is marked for the custom record.
- Clear the “Include Name Field” box on the Custom Record Type page for records created by your script.
- Clear the following options: “Allow Attachments,” “Show Notes,” and “Enable Mail Merge.”
- On the Permissions subtab, set the Level to Full for the roles: Administrator, Customer Center, and Shopper.
- Script Logic Verification:
- Review your script to confirm that the record type ID matches the ID of the custom record in NetSuite.
- Verify that the column IDs referenced in your script align with the column IDs on the custom record in NetSuite.
- Ensure proper handling of the true or false value returned in validation scripts; always return either true or false.
- Use the correct search operators when creating a search filter for custom records. For example, consider using “anyOf” instead of “equals” based on the column type.
- Simplify the Script:
- If permission errors persist, simplify the script to its most basic components.
- Wrap each script call in a try-catch statement to capture and log any errors.