function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AudiJamesAudiJames 

Formula for custom DELETE button

Hi! This is a tricky formula that I'm trying to create.

 

If the user is an ADMINISTRATOR ROLE of SalesForce, allow the record to be deleted when they click on the custom delete button.

 

ELSE

 

give a popup stating that the user doesn't have the permissions to delete the Opp.

 

Can someone help? 

Steve :-/Steve :-/

Why are you doing this at the Role level instead of the Profile level?

 

Anyway, I amended this formula to exempt certain User Profiles from a particular requirement.  You might be able to hack it up and use it for your User Role requirement by changing $Profile.Name to $UserRole.Name .   

 

 

 

 

IF(AND(Probability >= 0.50, NOT( $Profile.Name = "System Administrator"), NOT( $Profile.Name = "CSDS Executive Support"), NOT( $Profile.Name = "Executive Support"), NOT( $RecordType.Name = "Bundle Sales Opportunity") ),1,0)

 

 

 

AudiJamesAudiJames

Hi Stevemo -- I don't think we are using Profiles as such -- I have the formula like you have... showing me the IF statement in my custom button, but how can I insert the "delete" command if the IF statement passes successfully?

 

I know that if I fail the IF, I can do an alert(''You don't have access to this command... See an Administrator'')

 

IF(AND(Probability >= 0.50, NOT( $UserRole.Name = ''Key Account Administrator''), NOT( $Profile.Name = ''Opportunity Administrator'')),1,0)


Message Edited by AudiJames on 09-11-2009 11:00 AM
Steve :-/Steve :-/

Hi James,

 

I just posted my code as reference that you might be able to hack up, I don;t think that it will work the way that you want in the example you posted.  

 

You still might be able to accomplish what you want to do using Roles, Formulas, and your custom button, but it might be worth your while to start using Profiles on your SFDC Org.  They are specifically designed to handle things like Read/Edit/Delete permissions on secific record types, etc.  

 

 

 

Which edition of SFDC are you on?  and how many users do you have? 

AudiJamesAudiJames

Hi Stevemo,

 

I'll have to check more into the Profiles you speak of. I'm still a newbie in terms of SF users... We have Professional with 50 users at the moment.  

 

Thanks!!! James

 

AudiJamesAudiJames
Hi Stevemo, I don't seem to have Profiles in our version... :(
Steve :-/Steve :-/
Oh crap...  I don't think you can Manage Profiles on PE.  We've gotta figure out a way to get that custom button to work.  But that's gonna be a lot harder to do than I thought, because there's a TON of stuff going on behind the DELETE button than there is on EDIT, CANCEL, or SAVE buttons.  
AudiJamesAudiJames

I'm going to explore too -- I suppose there is a reason why they make 5 different kinds of mustard, but I'm quite frankly happier if only 1 exists!

 

:) James