Notes on Locked Records in NetSuite
Tags: netsuite, suitetalk • Categories: Web Development
Table of Contents
In NetSuite, records can be "locked". This is a special state that is poorly documented and introduces some very strange behavior. Hopefully, some of these notes save someone banging their head against the wall to solve this problem!
- Records can be locked in NetSuite in one of two ways: (1) the accounting period the transaction is in can be locked (2) or the record can be explicitly locked.
- You cannot determine if the accounting period is locked directly from the record. You’ll need to pull the associated AccountingPeriod
posting_period
object reference. - You cannot "explicitly" lock a transaction in NetSuite via the API. I have not found a way to do this through the GUI either.
- A workflow can lock a record in NetSuite. There’s a special action that you can run on a workflow that can lock a record. This is very confusing and makes it hard to debug since you need to dig into the workflow tied to the record to determine what is going on.
- You cannot determine if a record is locked by pulling the record from the SOAP/REST API. There’s no way to search or filter by locked records either. This makes it challenging to debug, especially if all you have is API access to an account.
- In the UI, if a record is locked, you’ll see a little lock icon at the top of the page. This is the only indicator in the UI that the record is locked.
- That records can be "soft" locked when they are tied to specific related transactions. For instance, if an undeposited CustomerPayment transaction is connected to a deposit, the payment is locked. All non-GL impacting aspects of the record can still be edited (a memo, for example).
Here is the example of the sort of error you’ll run into:
RCRD_LOCKED_BY_WF: This record has been locked by a user defined workflow.