Recently, I ran into a puzzling issue while building a customization in NetSuite. I had a User Event (UE) script that added a custom button to a record. When clicked, the button would open a Suitelet, which then generated a template for printing.
Both the UE and the Suitelet were explicitly set to execute as Administrator. On paper, this should have bypassed most permission or locking concerns. But when users clicked the button, they were greeted with the dreaded error:
"The record has been locked by a user defined workflow."
At first, this feels like a script-level problem. But here's the key insight:
Once a record is locked by a workflow, no script context—including admin execution—can bypass it.
So, what can you do?
Step 1: Identify Which Workflow Is Locking the Record
The error doesn't tell you directly which workflow is causing the issue. The quickest way is to:
Step 2: Check the Workflow Actions
Within the workflow, look for "Lock Record" actions.
Step 3: Adjust the Context Restrictions
Here's the trick: the record lock isn't global—it depends on the contexts you've defined in the workflow.
For example, in my case, the Suitelet was calling record.load() to fetch data for template printing. The lock was applied to Suitelet context, which blocked my script even though it was running as admin.
The fix:
Key Takeaways
About Us
Concentrus is a leading provider of innovative cloud-based enterprise resource planning (ERP) solutions, including NetSuite. Our team of NetSuite experts offers a range of services, including NetSuite price analysis, NetSuite training, and NetSuite integration services.
Our goal is to help businesses of all sizes maximize their investment in NetSuite by providing expert NetSuite cost optimization and implementation strategies. With years of experience as a NetSuite partner, our NetSuite administrators and NetSuite consultants are well equipped to help businesses of all sizes with their NetSuite consulting needs.
Whether you're looking for a NetSuite consultant to help with your NetSuite implementation or you need ongoing NetSuite support, Concentrus is here to help.
Read About Our Implementation Methodology
Want more NetSuite Tips and Tricks? Check out our Short & 'Suite videos