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

    Salesforce Administration Services: Why Every Business Needs Them in Today's Competitive Landscape

    Blog in Salesforce Admin

    In today's fast-paced and highly competitive business landscape, companies are constantly seeking ways to streamline their operations, improve customer engagement, and drive revenue growth. Salesforce,…

    Audit Trails, Business Growth, CCPA, Certified Administrators, Certified Salesforce Administrators
    Carol Sep 15, 2023
    1,585  Views
    Heroku-Salesforce Integration

    4 Ways to Achieve Heroku-Salesforce Integration

    Blog in Salesforce, Salesforce integration

    Heroku provides a cloud application platform to create, run, and work with your cloud-based application. Heroku supports several programming languages like JAVA, Python, and PHP.…

    App Cloud Integration Service, Approval Process, Benefits for Business, Businesses, Callouts in Apex
    360 Degree Jan 19, 2021
    1,920  Views
    Event in Salesforce

    Guide To Component Event And Application Event in Salesforce

    Blog in Salesforce

    Component Event Component event is fired by the when we instantiate the component. The component is fired from the child component and handled by the…

    Application Event, Application Occasions, Asynchronous Code, Child Component, Component Event
    Marziya Sep 3, 2020
    3,884  Views

    Popular Salesforce Videos

    Salesforce — How To Market Your Small Business

    Salesforce — How To Market Your Small Business

    Video in Others, Salesforce Stories, Marketing

    How can small businesses get the word out about what they do, and be strategic about it? Here are three important steps to consider when…

    Salesforce Training, salesforce, Salesforce Video, Salesforce Learning, Business
    Nauman Sep 2, 2020
    1,639  Views
    How to Prepare for Salesforce Platform App Builder (CRT-402) ?

    How to Prepare for Salesforce Platform App Builder (CRT-402) ?

    Video in Salesforce Certifications

    The Salesforce Platform App Builder certification focuses on the different declarative functions available to an admin. Development and code are not included, but it focuses…

    Salesforce Training, Salesforce Certification, Lightning Platform, Salesforce Video, Salesforce Learning
    Jogender Nov 6, 2020
    1,701  Views
    Installation & Configuration Process of Salesforce 9Calendar

    Installation & Configuration Process of Salesforce 9Calendar

    Video in AppExchange

    This video demonstrates the installation, configuration, and working of our latest Salesforce app 9Calendar. Watch this video till the end to understand its functionalities. Adding…

    Salesforce Tutorial, salesforce, App Builder, Salesforce Video, Salesforce VIdeos
    Tech9logy Sep 5, 2025
    94  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.