I have an app that uses the restforce gem to make queries against Salesforce. I ran into an issue with locked rows (UNABLE_TO_LOCK_ROW
error), so now I would like to select Contacts, Leads, Opportunities, and Tasks with the FOR UPDATE
clause, but I keep getting this error:
Faraday::ClientError: MALFORMED_QUERY: FOR UPDATE not allowed in this context
None of these queries work:
client.query("SELECT Id, Description from Task FOR UPDATE")
client.query("SELECT Id, Description from Task LIMIT 2 FOR UPDATE")
client.query("SELECT Id, Description from Lead FOR UPDATE")
client.query("SELECT Id, Description from Lead LIMIT 2 FOR UPDATE")
They all throw the error MALFORMED_QUERY
. How the heck am I supposed to use FOR UPDATE
?
If I can't use FOR UPDATE
with the REST API, how do I tell Salesforce I need to lock a row and prevent the UNABLE_TO_LOCK_ROW
error?
Any ideas would be helpful! Thanks!