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
netTrekker_ADnetTrekker_AD 

Opp VR: If field is not blank, then only certain profiles can pick stage Closed Won

Hello All,

 

I am trying to create an Opportunity Validation Rule that solves the following:

 

If the Channel Partner field is not blank, and the Opportunity Record Type is New or Renewal, you must have one of three User Profiles in order to change the stage to "Closed Won".

 

 Here are our specifics:

 

Channel Partner field (look up field): Channel_Partner_del__c 

Opportunity Record Type New:  RecordTypeId = "012800000006Ggk",

Opportunity Record Type Renewal: RecordTypeId = "012800000006Ggp",

User Profiles allowed to mark StageName "Closed Won":

$Profile.Name = "Thinkronize Partner User"  ||
$Profile.Name = "Thinkronize Power User+Create" ||
$Profile.Name = "System Administrator" 

 

Please help!

 

Thank you,

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Yeesh!  you mean you wanted a formula that actually WORKS???

 

Try this one (swap my field names and record types for yours) and try using RecordType.Name instead of RecordType.Id it makes life a lot easier, trust me.

AND(LEN(Rate_Card__c) > 0,

(IsWon),

NOT( $Profile.Name = "System Administrator"),

NOT($Profile.Name = "Marketing User"),

NOT($Profile.Name = "Standard User"),

AND(OR(($RecordType.Name = "Sales"),

($RecordType.Name = "Bundle"))))

 

 

 

Message Edited by Stevemo on 01-12-2010 10:50 PM

All Answers

Steve :-/Steve :-/

Try something like this

 

 

AND(LEN(Channel_Partner_del__c) > 0,

(IsWon),

$RecordType.Name = "Type 1",

$RecordType.Name = "Type 2",

NOT($Profile.Name = "Thinkronize Partner User"),

NOT($Profile.Name = "Thinkronize Power User+Create"),

NOT($Profile.Name = "System Administrator"))

 

 

Message Edited by Stevemo on 01-12-2010 05:06 PM
netTrekker_ADnetTrekker_AD

Thank you Stevemo, but that still does not work. Logged in as a user with a profile different from the three that are exempt, I was still able to select the Stage "Closed Won" and save successfully. I need it to throw the error message when this person tries to complete this action.

 

I replaced '$RecordType.Name = "Type 1"', with 'RecordTypeId = "012800000006Ggk",' and Type 2 with the second record type. Does this make a difference?

 

Thanks!

Steve :-/Steve :-/

Yeesh!  you mean you wanted a formula that actually WORKS???

 

Try this one (swap my field names and record types for yours) and try using RecordType.Name instead of RecordType.Id it makes life a lot easier, trust me.

AND(LEN(Rate_Card__c) > 0,

(IsWon),

NOT( $Profile.Name = "System Administrator"),

NOT($Profile.Name = "Marketing User"),

NOT($Profile.Name = "Standard User"),

AND(OR(($RecordType.Name = "Sales"),

($RecordType.Name = "Bundle"))))

 

 

 

Message Edited by Stevemo on 01-12-2010 10:50 PM
This was selected as the best answer
netTrekker_ADnetTrekker_AD

Stevemo, thank you!!

 

It appears to have worked in our sandbox. I will need to test it out with a few different user profiles, but so far it appears to be spot on. 

 

I appreciate your help!