-
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
Wrapper Classes in Salesforce | Here's What You Need to Know
Apex Wrapper Classes are custom classes in Salesforce that are used to hold one or more primitive data types as members. This allows for encapsulating…
Benefits of Hiring Salesforce Managed Services: Things to know
There is no doubt that Salesforce is one of the most powerful and versatile business tools currently available. Salesforce provides many benefits, such as streamlining…
Popular Salesforce Videos
Introducing KaseSync: An Innovative Community-CRM Connector! | Salesforce
KaseSync, is an innovative community-CRM connector designed to create seamless bi-directional data sync between platforms. Learn how exactly it improved self-service and boosts community engagement.
Salesforce Education Cloud Consultant: Interview Questions
Salesforce org Education Cloud is the complete customer relationship management software for colleges and universities, helping you track all of your constituent relationships, from prospects…
Salesforce on Salesforce: How Salesforce Uses Trailhead to Drive Enablement
With Trailhead, Salesforce is transforming the learning experience for our employees at every step of their career journey. Join us to learn tips, tricks and…