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, 1 month 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

    What are Pardot Forms? All You Need to Know

    What are Pardot Forms? | All You Need to Know

    Blog in Others

    Pardot is a powerful marketing automation tool that can help businesses streamline their lead generation and nurturing processes. One of the key features of Pardot…

    Automated Email Campaigns, Best Practices, Clear and concise copy, Company size, Conversion Rates
    Mohit Kumar Apr 26, 2023
    2,467  Views

    Salesforce Experience Cloud Support Portal: Key Considerations Before Implementation

    Blog in Salesforce Implementation

    In the realm of Salesforce Experience Cloud and its support portals, understanding the potential and possibilities is paramount. The Salesforce Experience Cloud is a robust…

    Assistance, Branded, Businesses, Canvas, Capabilities
    Advanced Sep 25, 2023
    1,511  Views

    Improving Customer Experience With an Integrated System

    Blog in Salesforce integration

    The Challenges The client was using two separate systems – Salesforce for customer support services and JIRA Software Cloud to track and release development operations.…

    Salesforce Integration, Salesforce Integration Partners, Salesforce Integration Services, Salesoforce Partners
    Rahul Oct 11, 2017
    7,039  Views

    Popular Salesforce Videos

    Salesforce Contact Tracing for Employees Demo

    Salesforce Contact Tracing for Employees Demo

    Video in Others, Salesforce Stories

    As businesses gradually reopen after worldwide closures, many people feel concerned about the second spike in COVID-19 cases. To ensure public safety, local officials have…

    salesforce, Salesforce Video, Reopening, COVID-19, Businesses
    Nauman Jun 30, 2020
    1,842  Views
    Salesforce Staff Has Option to Keep Working From Home

    Salesforce Staff Has Option to Keep Working From Home

    Video in Salesforce Stories

    Dan Bognar, head of the strategy for Asia at Salesforce.com Inc., discusses how the coronavirus outbreak is affecting the San Francisco-based software maker’s operations and…

    salesforce, salesforce consultants, Salesforce Video, Covid19, Reopening
    Pooja Jun 17, 2020
    1,526  Views
    Salesforce Tutorial - What Is Data Loader

    Salesforce Tutorial - What Is Data Loader

    Video in Others, Salesforce Products, Data

    Generally, in the Declarative approach, developer enters data with page-layout, Data Loader is an amazing tool for bulk data processing. I have seen many migration…

    Salesforce Training, salesforce, Salesforce Data, Salesforce Data Loader, Salesforce Developers
    Sam J May 12, 2020
    2,205  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.