The error UNABLE_TO_LOCK_ROW represents a Salesforce system-related record lock. This Salesforce limitation can’t be changed. You might also see this error in Salesforce when a record is being updated or created; the lock on that record prevents another operation from updating the record at the same time.
These locks normally last for a few seconds and when the lock is released, other operations can process normally. However, a given transaction can only wait a maximum of 10 seconds for a lock to be released; otherwise, it will time out. If the parent record stays locked for more than 10 seconds and when you try to obtain its lock to insert the child record, this error occurs.
You can resolve the above-mentioned error by configuring the Concurrency ID lock template. The error usually occurs when the concurrency level is set to greater than 1 on the Salesforce connection in your integrator.io account. It tries to send all the records in batches with the given concurrency.
To check the concurrency of your Salesforce connection in your integrator.io account:
- Log in to your integrator.io account.
- Go to Connections.
- Next to the Salesforce connection, click the three-dotted icon > Edit connection.
- Go to the Advanced section and verify the concurrency in the Concurrency level setting.
- Click Save & close.
On the Salesforce connection, if the concurrency is more than 1, without updating the given concurrency you can use the Concurrency ID lock template setting for sending the records in a queue. Changing concurrency on connection affects other flows which are using the same connection. To find and configure the Concurrency ID lock template setting:
- In the Salesforce - NetSuite integration app, for the flow in which you got the UNABLE_TO_LOCK_ROW error, go to the respective import to edit.
- On the Edit import window, click to expand the Advanced section.
- In the Concurrency ID lock template, enter {{record.Id}}
- Click Save & close.
After you configure the Concurrency ID lock template field, you need a constant in the export data. Every record data from export must have a constant which helps to identify the record as unique and queue them one after the other. We can use the constant from export data to configure the template in the Concurrency ID lock template field.
“Concurrency ID lock template” example
If you upsert the product entries with its price book entries as its child and with the API type as composite. If the number of price books is 6 and you are trying to enter the price book entries into the price books for each product and there are tons of products in export data, then there is a chance of occurring a lock error on the price book.
In the above sample data, the key id is a constant that repeats in all the export data.
Import Mapping:
For the above export data, when you click on the Concurrency ID lock template configuration, it will display a form like below
In which you can select your Id and configure the template. Once selected the required constant then save those settings and run the flow. This should resolve the UNABLE_TO_LOCK_ROW error.
Comments
Please sign in to leave a comment.