Questions tagged [locking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
2answers
3k 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. ...
8
votes
2answers
768 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
741 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 ...
9
votes
2answers
3k 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 ...
2
votes
0answers
378 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
362 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
1k 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
795 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
782 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 ...
9
votes
1answer
253 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....
6
votes
2answers
238 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 ...
6
votes
2answers
2k 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
2k 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
50 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
96 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
6k 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
571 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
134 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 = ...
2
votes
0answers
104 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
155 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 ...
3
votes
1answer
1k 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
4k 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
239 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....
5
votes
1answer
222 views

Bulk API Row Lock Root

How to get confirmation that Inserts/Deletes of Contacts using the Bulk API will cause Row Lock errors on the parent Accounts, especially if the # of Contacts is large and there are few parent ...
9
votes
1answer
11k views

Approval lock/unlock with APEX

I am in Winter '16 and trying to unlock and lock a record in APEX and I am getting the following exception FATAL_ERROR System.UnexpectedException: Apex approval lock/unlock api preference not ...
3
votes
1answer
169 views

allOrNone flag does not work when at least one record is locked

I am trying to create a reusable method which retries DML whenever record lock is detected. However, I noticed that even if you set database.update( collection, **false**) and there is at least one ...
1
vote
2answers
3k views

Why can't I lock/unlock records through apex?

In my attempts to use the Approval class methods to unlock locked records or to lock unlocked records, I have encountered the following warning: System.UnexpectedException: null I saw this error ...
4
votes
1answer
2k views

UNABLE_TO_LOCK_ROW Error with Test Class [duplicate]

When running all test classes from the Setup menu in a Sandbox org at the same time, I am receiving the error "System.DmlException: Insert failed. First exception on row 0; first error: ...
0
votes
0answers
643 views

UNABLE_TO_LOCK_ROW - Insert

I am inserting records into a custom object via interface. I deactivated the triggers on this object so there is no additional code getting triggered upon insert. Still i am receiving the error: ...
1
vote
0answers
312 views

Tips to prevent errors in execution of time-based workflow?

Our implementation includes a number of time-based workflow rules. Due to high volume, we have been experiencing frequent occasions where execution of updates to some records in the time-based ...
2
votes
2answers
863 views

Is it possible to use Apex Scheduler to run a batch class just once, 30 seconds after the scheduler is called?

I want to call a Schedulable class from within a trigger, to execute a batch job after waiting 30 seconds (or 5 seconds, as long as it's long enough to make absolutely sure the initial trigger ...
1
vote
1answer
116 views

Unable to lock record from Apex web service method

I have a class that's used to prioritize leads in a lead queue based on rules that our business users can create and manage. One method in particular is used to find the first record in the ...
0
votes
2answers
851 views

How to stop redirecting to the EDIT URL when clicked on "Related List" "edit" link?

I would want the record to not to redirect to the "Edit Page" when clicked on "Edit Link" instead want to "Alert" the user with a warning message. Basically, I am to lock a record when "the stage in ...
1
vote
1answer
923 views

Lock a checkbox based on another field

I have a picklist on my object called Type: New / Pending / Historical when the Type field is set to: New, then I would like to prevent another picklist field from being edited. This field is called:...
7
votes
4answers
4k views

I want to lock the record using apex

I am inserting the record using apex and visual force page. I want to lock the record when i click submit on the visualforce page.i.e when i open the record in salesforce I don't want the records to ...
2
votes
2answers
828 views

Lock Idea record on field update

I need a way to lock an Idea and its comments from being editable. I have a time-based workflow already set up to change a custom field after 30 days. The custom field is called voting status with ...
24
votes
2answers
2k views

Is it possible to simulate record locks in test methods?

I would like my test cases to also test exception handling. In theory an easy way to cause an exception on DML is to lock a record that it'll update so that the update will fail. But I'm having ...
10
votes
2answers
4k views

Reproduce UNABLE_TO_LOCK_ROW error

We're receiving the: caused by: System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: [] exception in ...
7
votes
2answers
3k views

Can a DML retry solve UNABLE_TO_LOCK_ROW race conditions?

I have 2 Batch classes working on different child objects of a common master object. Batch Batches are started parallel to speed up this long running cleansing operation. It depends on the underlying ...
3
votes
1answer
1k views

What actions would cause a record to be locked?

Yesterday, some Users experienced an error when attempting to change the Owner on open Cases using the Salesforce interface. This issue lasted for about an hour. Afterwards, updating the Owner on ...
10
votes
1answer
375 views

do methods execute atomically?

Do apex methods execute atomically? Is this method acceptable as-is or could multiple users cause a race condition? public static Integer transactionID(){ TradeCount__c t=[SELECT ...
3
votes
1answer
7k views

UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record

I have a batch process which updates Accounts and sometimes when i run this batch i get the error. UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record I did read through Mohit's ...
11
votes
2answers
7k views

Salesforce Parent Locking 'UNABLE TO LOCK ROW'

Does salesforce lock Account Record when user try to update/create following child objects - AccountTeamMember Opportunity Line Item (Does sfdc lock opportunity here as well?) Task Contact ...
5
votes
2answers
2k views

Can one implement a Mutex / Lock / Semaphore in Salesforce?

I have multiple processes (teams of users) that need to mutually exlusive work on the sames data records in Salesforce. Is there a way to simulate a kind of Mutex or Semaphore in Salesfore (e.g. ...
-1
votes
1answer
3k views

UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: [duplicate]

I am creating case through trigger,but i am getting the UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: can anybody help me...
48
votes
5answers
17k views

SOQL Record Locking : For Update

Well I was trying to Implement Record Locking apex but Salesforce Document doesn't seem to help much. Even tried searching stackexchange there was a old question but the answer form StackExchange and ...
38
votes
1answer
645 views

Help me solve a concurrency mystery (platform bug? Expected behavior? Or am I missing something?)

To set up the problem, add a new currency data type custom field called Test_Counter__c to the Opportunity Object. Then create a test opportunity named TestOp. Then create the following class: ...

1
2