Skip to main content

#Locking0 utenti parlano di questo argomento

🚀 How to Lock Records in Salesforce - A Step-by-Step Guide 🔐

 

Ever wondered how to secure your Salesforce records post-lifecycle? 🤔

 

In Salesforce, sometimes you would want to lock records in Salesforce so that they can no longer be edited or deleted. When a record has reached the end of its lifecycle, nobody should be allowed to modify the record any longer. ❌

 

For example, once an opportunity is closed (won or lost), it just needs to live in the system without being touched. Same can be for “Cases” or records sitting in your custom objects. Or maybe once a record has been interfaced to a backend system, you would want to lock the record so that it can no longer be modified in Salesforce.

 

Locking records will safeguard your data's integrity. 💪

 

Traditionally Salesforce professionals have used different options to meet this requirement & each of these options have its own pros and cons. They include:

 

1. Using Record Type & Page Layouts

2. Using Record Ownership

3. Using Apex Trigger

4. Using Validation Rule

5. Using Custom Visualforce Page

 

But none of these options are elegant and fool-proof.

 

In this guide, we will explore a better option (in my opinion), where we will actually “lock” the record using a couple of declarative features of Salesforce. Once locked the end users will see an error (please refer to the screenshot attached below) when they try to edit the record. 👌

🚀 How to Lock Records in Salesforce - A Step-by-Step Guide 🔐 Ever wondered how to secure your Salesforce records post-lifecycle?

The complete step-by-step guide with screenshots is available at URL https://www.asagarwal.com/how-to-lock-records-in-salesforce/

 

🚀 Empower your Salesforce journey! Don't miss out on this invaluable resource. If you find this guide helpful, stay tuned for more actionable insights. Subscribe to my newsletter at https://www.asagarwal.com/subscribe/ for instant updates on future step-by-step guides.

 

#Step By Step Guide #Locking

1 commento
0/9000

We update a QuoteLineItem record to update a date field. This sometimes works perfectly, but sometimes fail with:

unable to obtain exclusive access to this record or 1 records: 0066900001iznb8AAA

As we can see, this is an opportunity ID.

 

Why does updating an QuoteLineItem record locks the Opportunity?

 

What i noticed is that we have an rollup summary on Quote to rollup QuoteLineItem records. Can this be the reason? Or could there be other causes?

 

We don't see any rollup-summary from Opportunity to Quote.

 

#Apex #Records #DML Errors #Locking DML #Locking

3 risposte
0/9000

Hoje vamos falar sobre o SOQL Locking Records, imagine o cenário onde você precisa garantir que os registros não serão acessados enquanto...

 

#Apex #Locking #Salesforce #SalesforceDeveloper #SalesforceDevelopment #SOQL

Entendendo o uso do SOQL Locking Records

0/9000

Hoje vamos falar sobre o SOQL Locking Records, imagine o cenário onde você precisa garantir que os registros não serão acessados enquanto...

 

#Apex #Locking #Salesforce #SalesforceDeveloper #SalesforceDevelopment #SOQL

Entendendo o uso do SOQL Locking Records

0/9000