-
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
REST API in Salesforce | The Ultimate Guide
What is REST API? REST stands for Representational State Transfer, which is a web architecture that uses HTTP protocols to access and manipulate resources. REST…
Don’t Neglect these Salesforce Application Development Considerations
Are you a Salesforce user and have the thought of building dynamic apps on the Salesforce platform? If yes, then you have come to the…
Best Practices for Salesforce Integration: Streamlining and Optimizing Your Workflow
Salesforce integration plays a crucial role in connecting your org with other systems, streamlining workflows, and enabling data-driven decision-making. To ensure successful integration, it’s essential…
Popular Salesforce Videos
Add Sound Effects to Your Salesforce Org | Salesforce Tutorials | #SalesforceBolt
In this video you will learn to Use a Lightning Web Component to play a fun sound when a big deal closes. You can play…
Find Newly Created Fields in Salesforce
In this series, we do a deep dive into a specific business problem and share how one #AwesomeAdmin chose to solve it. Once you learn…
Benefits of Having Veteran In an Organization | Career in Salesforce
Let's Understand how a veteran can start their career in Salesforce? In this Episode Davis and Shrey covered the following questions: 1. About his background and…