-
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
How to use aura:set in Salesforce Lightning?
aura:set - <aura:set > is used to set the value of an attribute inherited from a parent component, event, or to set the value of…
Review of Top 5 Free Salesforce Data Cleansing Tools [+ Salesforce Data Cleansing Best Practices]
Keeping your CRM data clean is not only a technical activity. It also involves a creative mind, time, and deep knowledge of the business nuances…
Popular Salesforce Videos
Escalation Rule in Salesforce
In this video, Shrey is not only teaching but also demonstrating Escalation Rule in Salesforce. 1. What are Escalation Rules in Salesforce? 2. What is…
Create an Email Alert Workflow Rule | Workflow Rules in Salesforce | Salesforce Automations
Configuring Workflow Rule Email Alerts or Notifications Follow. Workflow Rules are automatic processes that trigger an action when a certain event occurs, such as updating…
Solving the Fizz Buzz (AMPscript) in Salesforce Marketing Cloud
Cameron Robert from Datarati uses 2 different approaches to solve the Fizz Buzz programming challenge using AMPScript Salesforce Marketing Cloud. What you'll learn: » How…