Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to prevent a Salesforce record from being deleted in account object when rating is set to hot?

    Tagged: Account Object, Rating, Salesforce Records

    • Salesforce® Discussions

      How to prevent a Salesforce record from being deleted in account object when rating is set to hot?

      Posted by Radhakrishna on August 21, 2017 at 4:04 AM

      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 ?

      Shaharyar replied 8 years, 5 months ago 2 Members · 1 Reply
      • Account Object
      • Rating
      • Salesforce Records
    • 1 Reply
    • Shaharyar

      Member
      August 21, 2017 at 6:19 AM

      trigger preventDeletionAccount on Account (before delete) {
      List<Account> acc=new List<Account>();
      for(Account acc:trigger.old)
      {
      if(acc.Rating=='Hot'){
      acc.addError('Prevents Deletion');
      }
      }
      }

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    How to use aura:set in Salesforce Lightning?

    How to use aura:set in Salesforce Lightning?

    Blog in 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…

    AURA, Aura in Salesforce, aura:set, Salesforce Lightning, Salesforce Lightning Attributes
    Aman May 8, 2018
    40,597  Views
    Salesforce Marketing Cloud

    Benefits of Salesforce Marketing Cloud For Retail Business

    Blog in Salesforce

    Marketing Cloud is the marketing platform of Salesforce and enables the brand to interact with its existing and potential customers across all channels, emails, social,…

    Artificial Technology, Big Data, Building Relationships, Client Requirements, Clients
    AnavClouds Software Solutions Oct 28, 2020
    6,942  Views

    Review of Top 5 Free Salesforce Data Cleansing Tools [+ Salesforce Data Cleansing Best Practices]

    Blog in Salesforce Data integration

    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…

    API, AppExchange, Ascendix Search App for Salesforce, Automated Data Cleansing, Bad data
    Angie Sep 21, 2021
    3,012  Views

    Popular Salesforce Videos

    Escalation Rule in Salesforce

    Escalation Rule in Salesforce

    Video in Others, Salesforce Training

    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…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Jogender Apr 19, 2021
    1,981  Views
    Create an Email Alert Workflow Rule | Workflow Rules in Salesforce | Salesforce Automations

    Create an Email Alert Workflow Rule | Workflow Rules in Salesforce | Salesforce Automations

    Video in Salesforce Training

    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…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Prafull Jun 28, 2022
    2,298  Views
    Solving the Fizz Buzz (AMPscript) in Salesforce Marketing Cloud

    Solving the Fizz Buzz (AMPscript) in Salesforce Marketing Cloud

    Video in Marketing, Salesforce Cloud Platform, Salesforce Training

    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…

    Salesforce Tutorial, salesforce, Salesforce Marketing Cloud, Salesforce Video, Salesforce Learning
    Cameron Sep 5, 2025
    1,302  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.