Questions tagged [locking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
121 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
620 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
104 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
146 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 ...
5
votes
1answer
7k 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
120 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
2k 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 ...
3
votes
1answer
910 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
559 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
246 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
589 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
90 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
608 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
776 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
3k 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
607 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 ...
22
votes
2answers
1k 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 ...
9
votes
1answer
2k 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
2k 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
975 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
364 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
4k 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 ...
4
votes
2answers
1k 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...
41
votes
4answers
12k 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 ...
37
votes
1answer
599 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: ...