-
How to prevent a Salesforce record from being deleted in account object when rating is set to hot?
trigger Tour on Account (before insert ) {
Account sam=Trigger.new[0];
if(sam.Rating=='Hot' )
{
sam.AddError('record cannot be deleted');
}
}Even though when I run this record is deleting.
can someone help me with this ?
Log In to reply.
Popular Salesforce Blogs

Salesforce Marketing Cloud: Your One-stop Marketing Solution
The Word-class CRM solution, Salesforce does not leave any room for doubts and connects brands and customers in the best possible way. With multiple cloud…

Salesforce Implementation Techniques that are Designed to Fail
When you wish for your business to grow, you would definitely shift your list of contacts off of paper and into the modern age 21st…

Salesforce PDO Partner Program 2021: A Guide
Salesforce AppExchange has been a huge hit across its 15-year lifespan and is the key differentiator for Salesforce when it comes to the global CRM…
Popular Salesforce Videos
Salesforce Marketing Cloud Connector for UiPath
This is a connector for Salesforce Marketing Cloud that allows you to work in the background with SFMC instance. watch this video and let us…
Auditing Account Deletion Using Salesforce Flow
This demo video walks through an example of Auditing Account Deletion Using Salesforce Flow Ever had an instance where users have accidentally deleted Accounts and…
Salesforce Building Blocks with Accenture and OwnBackup
Join experts from Accenture, OwnBackup and Copado for a panel on the future of low-code SaaS. Get key building blocks that fuel Salesforce success and…