Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [locking]

The tag has no usage guidance.

1
vote
2answers
22 views

User hits record lock error despite class without sharing

My users keep hitting a record lock error despite the class being defined as without sharing. My understanding is that without sharing allows locked records to be edited by any user. This class is the ...
0
votes
0answers
15 views

How to avoid locking a record when the approval process is pending?

I need to have records of a given objects unlocked during the pending phase of the approval process. I tried to use a trigger on the object under the after update condition and check the status of ...
6
votes
1answer
39 views

Apex Approval.lock, programmatic locking and record editability

Background: In Winter '16, Salesforce introduced the Approval class for setting approval locks and unlocks through Apex (release notes). Since then, my company has been leveraging this functionality ...
0
votes
1answer
34 views

Records are not getting locked with “Approval.LockResult” class

On Using "Approval.LockResult" class, In debug logs i can see the records are successfully locked but in reality the records are not saved and i cannot even see the lock/unlock button on record detail ...
0
votes
2answers
30 views

Locking rows at the last minute

I have a utility routine (pasted below) that I use for all writes to the database which lets me catch errors. This works perfectly in all but one of my orgs. In that org, I generate a ton of ...
0
votes
0answers
23 views

CTI and Record Lock

I have an issue where records are being locked while my reps are using them. The basic steps are like this: Navigate to Opportunity Contact information is pulled via an Action Layout Editor Rep ...
0
votes
0answers
22 views

Validation Rule to “Lock Up” UTM Fields on Opportunity when the Opportunity is created [duplicate]

I am trying to lock the UTM fields on an opportunity when it is created. I would the field to not be able to be edited by anyone (including Marketo Sync User) other than a system admin after the ...
0
votes
1answer
50 views

Tasks Updates--Locking issue

We are currently facing issue while updating tasks via dataloader or workbench. We are updating tasks of around 8 lakhs. Problem is tasks are linked to account which locks the accounts while updating ...
6
votes
1answer
61 views

Users getting “Unable to obtain exclusive access” Error

My users are attempting to work in records and occasionally get the error message of Unable to obtain exclusive access to this record or 1 records: [id]. This error is intermittent and I cannot find ...
1
vote
2answers
77 views

Salesforce Bulk API Unable to lock row

I'm currently using the Salesforce Bulk API within a Rails app to update a custom object in Salesforce. This works fine when I send a single record through, but when I batch in sets of 200, I get ...
0
votes
1answer
59 views

Process multiple inbound requests in parallel

I have an inbound interface in my Salesforce org, it updates existing account records. The inbound interface being called by number of third party systems. Whenever two different requests try to same ...
10
votes
1answer
127 views

FOR UPDATE returns old values

I use FOR UPDATE locking in a query but when the first execution completed, the second execution (started while records were locked) seems to use the old data set. I played around for a while and ...
0
votes
1answer
228 views

Lock and Unlock opportunity object during approval process

I have an approval process for the Opportunity object. But I want to unlock a record during this process to add a very important information that can only be obtained later and then lock the record ...
0
votes
0answers
193 views

Unable to lock row - Record currently unavailable error

I know there has been lot of things available online for record locking errors but I am putting my analysis based on client issue that we are facing, would appreciate if I can get any thoughts. We ...
0
votes
1answer
49 views

How to skip transaction locked record in SOQL

Consider multiple processes are accessing a set of frequently updating records and they pick whatever matches certain criteria. They should lock those picked up records. So almost at the same time if ...
0
votes
1answer
95 views

UNABLE_TO_LOCK_ROW during send email

I have a code where I send email using single email message. I am setting targetObjectId as a contact Id. I am getting the following error: System.EmailException: SendEmail failed. First ...
0
votes
1answer
57 views

Relock record after approval process

Is there a way to re-lock a record immediately after it has been approved via an Approval Process (in the same transaction)? It seems like a simple thing to do via a Trigger but I have an After ...
4
votes
1answer
259 views

Optimistic locking when working via REST API

I have a case when SF data can be updated concurrently by humans with UI and by a Ruby app via REST API, so I'm worried about the possibility they overwrite changes of each other. Is there a standard ...
2
votes
0answers
48 views

Resolving UNABLE_TO_LOCK_ROW issue

Is there any way to identify which transaction/class took the lock the record when we get this UNABLE_TO_LOCK_ROW issue. Simply giving UNABLE_TO_LOCK error and not giving the idea about he potential ...
0
votes
1answer
227 views

how did Record lock in salesforce in my scenario and how to avoid it?

we have a scenario where User role is changes we have to update Account field then Account's trigger will update 5 related objects so their triggers also fire :) . Earlier we have used process builder ...
1
vote
1answer
67 views

Apex Approval Process Locks on DML Statements

I have a custom button on a record which is designed to update the record's status. There is a separate process within a different class, which is locking the record. I need my pageRef to unlock the ...
1
vote
1answer
228 views

Waiting for a record to be unlocked in Apex

As You know how we can lock records in Apex by adding a FOR UPDATE at the end of SOQL query. In one of my classes I have to query for a bunch of records and then updating them. In this query I use ...
1
vote
1answer
48 views

Is it possible to have a validation rule with a finely nuanced loophole to create and modify detail records?

We have Opportunity with a custom checkbox property "Locked__c". While this value is set to true (never mind how), it should be impossible to change any value on the Opportunity. The Opportunity has ...
4
votes
1answer
274 views

SObject type does not allow locking rows

I am trying to update a group of records satisfying certain conditions it was giving me Error which says:- UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 10 records so ...
1
vote
0answers
68 views

Challenge unlocking a list of objects in my logic

I am trying to using Approval class to lock and unlock records of an object xyz__c. When I run the below code I still see the record as locked and unable to perform update on it: List<xyz__c> ...
0
votes
1answer
700 views

Unlocking and locking a record in approval process in one Transaction

In this scenario I have two object Foo__c and zoo__c. Whenever a particular field in Foo__c is updated it should update certain fields in zoo__c object. My problem : Some of the zoo__c records can ...
2
votes
0answers
113 views

Group membership locks - Territory Hierarchy updates & Sharing recalculations

I read through the Record Locking Cheat Sheet to understand record locking concepts and have some follow-up questions: What can be the cause of Group membership locks with relevance to Territory ...
3
votes
2answers
510 views

Implicit sharing & Record locking

I am trying to understand if Implicit sharing capability can be used to avoid record locks or increasing performance of update operations on master-detail records. I am referring to this link here. ...
5
votes
1answer
191 views

GroupMember locking

For out project we need to put users into correct public groups. This happens in a trigger when a user's contact is updated, depending on some of the fields there we decided where to put a user. The ...
0
votes
1answer
297 views

How to make accounts read-only / locked?

It's a long story, but we have a group of account in SF that we'd like to make read-only. Ideally, these records would... Remain accessible to the same people they were before No longer be editable ...
6
votes
2answers
853 views

The cause of UNABLE_TO_LOCK_ROW error?

My scenario is as followed, I have a single Parent account with about 600 child accounts. Every child account has a single Opportunity with 2 or more lines. I have a monthly batch job to create ...
3
votes
0answers
242 views

Checking Object Lock status using REST API

We are running into the object lock contention UNABLE_TO_LOCK_ROW error when attempting to create a record in the CampaignMember object using AMPscript in Marketing Cloud due to the high lock ...
0
votes
1answer
114 views

Organization Administration Locked

good old message is the following : Organization Administration Locked The changes you requested require salesforce.com to temporarily lock your organization's administration setup. However, ...
2
votes
0answers
688 views

CreateSalesforceObject AMPscript function and Record Locking Concurrency

We are using the CreateSalesforceObject AMPscript function to create a new record in the Salesforce CampaignMember Object when an email is sent, by including the following code in an email: set @...
1
vote
1answer
359 views

Causes of organization lock

I recently tried to deploy some changes between sandboxes using the Force.com migration tool and got the following error: Failed to process the request successfully. Cause(ALREADY_IN_PROCESS): null:...
1
vote
1answer
321 views

Can a future method conflict with a queuable method?

My custom code is executed using a queuable class. Sometime it runs perfectly, other times it gives this error: Failed to update list. Error: System.DmlException: Update failed. First exception ...
8
votes
1answer
122 views

Will a DML ever lock a “grandparent” record?

Let's say I have two levels of master-detail relationships. Grandparent object is master-detail to Parent obj, which is in turn master-detail to Child object. I have an existing Granparent record G1....
5
votes
2answers
116 views

Pessimistic Lock Released after Callout

The documentation says: The lock gets released when the transaction completes. However I can validate that it also gets released when a callout is made! Here a two test methods: public static ...
5
votes
2answers
773 views

Disable Parallel Test vs. Always Run Asynchronously in Dev Console - Who wins?

I love to run my tests in the Dev Console with the Always Run Asynchronously checkbox enabled as it saves time. On the other side during our automated Nightly Test run I would like to disable ...
11
votes
1answer
1k views

When is a FOR UPDATE lock released?

The Salesforce docs say that The lock gets released when the transaction completes Does that mean when the record is updated, or when the execution context completes?
-1
votes
1answer
48 views

How to set certain Opportinity fields to remain locked during the Submit for Approval process [closed]

I need to be able to have certain Opportunity fields to remain locked during the Approval process? There are few Opportunity custom fields which I need to keep locked during the Submit for Approval ...
1
vote
0answers
68 views

Questions on row locking/transaction control

I have a process that first reads a custom setting value to use in a numbering scheme (can't use auto-number), it +1 that value, updates it, then does a number of DML/logic code which can take a ~2-10 ...
1
vote
2answers
2k views

Locking the fields and buttons when a certain condition is met

I have situation here, where I want to lock all the fields and buttons on a quote__c (custom object) where the status of the quote is changed to 'Sent' so that nothing can be editable on the quote. ...
1
vote
1answer
263 views

Unlock opportunity object during approval process [closed]

I have an approval process for Opportunity object. In the beginning of the approval process the Opportunity is locked and in the end the Opportunity object is unlocked. What I want to achieve is the ...
0
votes
2answers
73 views

Can not update an Id field [closed]

I'm using the following javascript code to unlock an Opportunity object. Opportunity.PoSa_Platform_Provider__c}{!requireScript("/soap/ajax/25.0/connection.js")} //Get the URL String var recordURL = ...
3
votes
0answers
91 views

Unlock parent, then update child, then again lock back the parent

I have a batch class that is used to update a Field1 of Obj1. Obj1 is child of Obj11. Inorder to update Obj1, I need to unlock its parent Obj11 first. [by updating lock__c=false]. Then update ...
2
votes
0answers
119 views

Salesforce Optimistic Record Locking and JavaScript Updates

Is there a way to implement field only updates for Salesforce? Even if fields could be updated concurrently through JavaScript/JavaScript remoting calls, would Salesforce still save the record using ...
2
votes
1answer
576 views

Would updating children records at the same time cause “UNABLE_TO_LOCK_ROW” error? How can I avoid this?

I have 3 objects with the below relationship: One Account(Master) Opportunity(Detail) Custom__c(Parent) (lookup on opportunity) Opportunity(Child) Here's the scenario: I have 1 ...
3
votes
3answers
2k views

Edit Fields in Closed Opportunity

I've given a Profile read/write access over several fields on the Opportunity level. However, because the record is locked after Closing Lost or Won, they cannot edit the fields. How can I choose to ...
1
vote
0answers
99 views

Can a validation rule cause a record to be locked?

I've been having trouble with a large system which uses lots of batch processes where I keep getting errors with UNABLE_TO_LOCK_ROW exceptions. I read the locking Cheat Sheet here: http://resources....