Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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 9 years, 2 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

    Popular Salesforce Blogs

    Why Should you Hire a Salesforce Pardot Consultant: Key Reasons to Know

    Blog in Salesforce

    Are you finding Salesforce Pardot Implementation a daunting task? Don’t worry. We are here with our complete guide on Salesforce Pardot Consultants and why should you hire them.    What…

    Marketing Automation, Marketing Campaigns, Marketing Cloud, Marketing Cloud Functionality, Marketing Qualified Leads
    connect@codinix.com Mar 26, 2023
    2,222  Views
    Epicor Kinetic ERP for Manufacturers

    How Epicor ERP Software and AI Drive Smarter Manufacturing

    Blog in AI and ML, CRM/ERP consulting, Salesforce

    Modern manufacturing businesses need more than basic systems to manage production, inventory, finance, and customer operations. They need connected technology that can turn business data…

    Epicor ERP, Epicor ERP For Manufacturers, epicor software, epicor software company, Global Manufacturing ERP
    Key Dynamics Sep 10, 2026
    193  Views
    metadata api

    Understanding Metadata API in Salesforce | The Developer Guide

    Blog in Coding and Scripting

    Metadata API Salesforce Metadata API is utilized to help designers in retrieving, creating, deploying, updating, or deleting the customized information. It can be something that…

    Asynchronous Tests, Aura Parts, Custom Fields, custom object, Enterprise WSDL
    Ayush Jul 9, 2020
    21,812  Views

    Popular Salesforce Videos

    CPQ B2B Commerce Cloud Connector | Salesforce Tutorial

    CPQ B2B Commerce Cloud Connector | Salesforce Tutorial

    Video in Salesforce Products, Salesforce Training

    In these difficult economic times, businesses are looking for ways to improve efficiency and reduce the cost of doing business. More than ever, efficiency and…

    Salesforce Training, Salesforce Tutorial, salesforce, CPQ, Salesforce Video
    Algoworks Nov 16, 2021
    2,926  Views
    Get Started with Salesforce Elevate

    Get Started with Salesforce Elevate

    Video in Salesforce Stories

    Salesforce is a powerful tool to analyze your past fundraising, and monitor your ongoing efforts. In this webinar, we'll start with the fundamentals -- understanding…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Webinar, Salesforce Video
    Prafull Feb 4, 2022
    2,438  Views
    Embedding Salesforce Einstein Predictions in Tableau with Tomasz Bacewicz

    Embedding Salesforce Einstein Predictions in Tableau with Tomasz Bacewicz

    Video in Salesforce Einstein

    Get the most out of Salesforce Einstein Discovery and Tableau by embedding Predictions directly in your Dashboards! Learn how from a pro. Watch this video…

    Salesforce Training, Salesforce Einstein, Salesforce Einstein Discovery, Salesforce Video, Tableau
    Abhishek Sep 3, 2020
    2,101  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.