Video Success Tip 10 – How To Fix The Delete Button in Every Edition of Salesforce CRM

Back to Blog Home

It’s annoying and wastes valuable time when a user ‘accidentally’ deletes a record in Salesforce. “I was sure I logged that call”, “No, that opportunity never existed”…. Would you like a way to avoid these conversations with your users and sales reps even if you’re using one of the lower/cheaper editions of Salesforce?

Well, you can stop wasting time now. The video below shows you precisely what to do to stop users deleting records in Salesforce. It’s very straightforward and all the steps you need to take are covered. So, within the next few minutes you can gain more control over the Delete button and avoid the problems of data disappearing through accidental deletions.

Beneath the video are the ‘code snippets’ that are referred to. All you need to do is highlight these, and copy & paste them into your Salesforce organisation as described in the video.

If you hit any problems or would like us to do the fix for you – do get in touch by email, phone or Twitter.  All our contact details are at the bottom of the page.
If you don’t want to follow the steps in the video, you can order this fix online for just £75.00+VAT.

Press the Buy Now button to make the payment securely through PayPal and on receipt of your order we’ll contact you to make the necessary changes to your Salesforce Organisation.

Good Luck and No More Accidental Deletions!

Fix The Delete Button in Salesforce – Code Snippet for Accounts

Use this code on your “PreventAccountDelete’ Visualforce Page.  Don’t forget to change the ‘Enter User Alias Here’ text for the alias of the person who is allowed to delete accounts.

 

<apex:page action="{!if($User.Alias !='Enter User Alias Here',
    null,
    urlFor($Action.Account.Delete, $CurrentPage.Parameters.id, [/fusion_builder_column][fusion_builder_column type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][retURL='/001'], true)
    )
    }"
  standardController="Account">
     <apex:pageBlock >
        <apex:PageMessage summary="You are not allowed to delete Accounts"
            severity="Warning"
            strength="3"/>
        <apex:pageMessages />
    </apex:pageBlock>
</apex:page>

Fix The Delete Button in Salesforce – Code Snippet for Contacts

Use this code on your “PreventContactDelete’ Visualforce Page.  Don’t forget to change the ‘Enter User Alias Here’ text for the alias of the person who is allowed to delete contacts.

 

   
<apex:page action="{!if($User.Alias !='Enter User Alias Here',
 null,
    urlFor($Action.Contact.Delete, $CurrentPage.Parameters.id, [retURL='/003'], true)
    )
    }"
  standardController="Contact">
     <apex:pageBlock >
        <apex:PageMessage summary="You are not allowed to delete Contacts"
            severity="Warning"
            strength="3"/>
        <apex:pageMessages />
    </apex:pageBlock>
</apex:page>

Fix The Delete Button in Salesforce – Code Snippet for Tasks

Use this code on your “PreventTaskDelete’ Visualforce Page.  Don’t forget to change the ‘Enter User Alias Here’ text for the alias of the person who is allowed to delete tasks.

 

<apex:page action="{!if($User.Alias !='Enter User Alias Here',
    null,
    urlFor($Action.Task.Delete, $CurrentPage.Parameters.id, [retURL='/00T'], true)
    )
    }"
  standardController="Task">
     <apex:pageBlock >
        <apex:PageMessage summary="You are not allowed to delete Tasks"
            severity="Warning"
            strength="3"/>
        <apex:pageMessages />
    </apex:pageBlock>
</apex:page>

Fix The Delete Button in Salesforce – Code Snippet for Opportunities

Use this code on your “PreventOpportunityDelete’ Visualforce Page.  Don’t forget to change the ‘Enter User Alias Here’ text for the alias of the person who is allowed to delete opportunities.

 

<apex:page action="{!if($User.Alias !='Enter User Alias Here',
    null,
    urlFor($Action.Opportunity.Delete, $CurrentPage.Parameters.id, [retURL='/006'], true)
    )
    }"
  standardController="Opportunity">
     <apex:pageBlock >
        <apex:PageMessage summary="You are not allowed to delete Opportunities"
            severity="Warning"
            strength="3"/>
        <apex:pageMessages />
    </apex:pageBlock>
</apex:page>

 

 

“How could the Cloud help your business and what other tips would you find useful?

Give us a call today on 01279 882290 (lines are open 24/7), send us an email or  tweet!”

[email protected] or tweet @CRMSuperStars

Success Tips from CRM SuperStars

Marketing Automation launches made easy

‘LightningStart’ – your fast, effective route to an operational platform with both Pardot or Salesforce® Engage.

Need help with your successful Salesforce Implementation for your business?