You need to sign in to do that
Don't have an account?
durga prasad 45
loking records
can any one give how to lock the records from one user to another user while updating
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
1) http://amitsalesforce.blogspot.com/2015/03/locking-statements-for-update.html
Apex allows you to lock sObject records while they’re being updated in order to prevent race conditions and other thread safety problems. While an sObject record is locked, no other client or user is allowed to make updates either through code or the Salesforce user interface. NOTE:-
While the records are locked by a client, the locking client can modify their field values in the database in the same transaction. Other clients have to wait until the transaction completes and the records are no longer locked before being able to update the same records. Other clients can still query the same records while they’re locked.
If you attempt to lock a record currently locked by another client, you will get a QueryException. Similarly, if you attempt to update a record currently locked by another client, you will get a DmlException.
If a client attempts to modify a locked record, the update operation might succeed if the lock gets released within a short amount of time after the update call was made. In this case, it is possible that the updates will You can’t use the ORDER BY keywords in any SOQL query that uses locking
See this link--https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_locking_statements.htm
http://www.asagarwal.com/2426/how-to-lock-records-in-salesforce
https://developer.salesforce.com/forums/?id=906F00000008kfkIAA
Thanks
Rupal
Mirketa Software Pvt Ltd
http://mirketa.com/index.html