Ask Search:
Marlon BandhoeMarlon Bandhoe 

Picklist value restriction for specific users

Hi Guys,

Having some issue with a formula. A few admins from the community gave some help but still running in issues I'd like to restrict  2 values for  specific profiles. So the meaning is when in the field Customer Group the value's: Dealers or Resellers are selected the selected profile must not be able to change value to another picklist value. if Other value's are selected they may change it.

Code below

AND ( 
OR ( 
ISPICKVAL (Customer_Group__c, 'RESELLERS'), 
ISPICKVAL (Customer_Group__c, 'DEALERS')), 
ISCHANGED (Customer_Group__c), 
OR ( 
$Profile.Name="Key Account Manager NL", 
$Profile.Name="Rayon Accountmanager NL", 
$Profile.Name="Manager Sales NL") )

Problem now is:
Profiles can change the value  when Dealers or Resellers value is selected. This is exactly what i don't want.
And when other values are selected  they can't change it to Dealers or Resellers.

Hope you guys can help me..
 
Best Answer chosen by Marlon Bandhoe
Amit SinghAmit Singh
There is a small modification in the formula try below
AND ( 
	ISCHANGED (Customer_Group__c),
	CASE(
		PRIORVALUE(Customer_Group__c),
		"RESELLERS",1,
		"DEALERS",1,
		0
	)=1, 
	CASE( 
		$Profile.Name,
		"Key Account Manager NL", 1,
		"Rayon Accountmanager NL", 1,
		"Manager Sales NL",1,
		0
	)=1
)

 

All Answers

Amit SinghAmit Singh
Hi Marlon,

Quick question here. Do you want to restrict the mentioned profile user to change the value ot Resellers and Dealers? 
Give it a try
AND ( 
	ISCHANGED (Customer_Group__c),
	CASE(
		Customer_Group__c,
		"RESELLERS",1,
		"DEALERS",1,
		0
	)=1, 
	CASE( 
		$Profile.Name,
		"Key Account Manager NL", 1,
		"Rayon Accountmanager NL", 1,
		"Manager Sales NL",1,
		0
	)=1
)

Use CASE function instead of OR so that you can add/remove the field in future very easily.

Regards,
Amit 
Amit SinghAmit Singh
There is a small modification in the formula try below
AND ( 
	ISCHANGED (Customer_Group__c),
	CASE(
		PRIORVALUE(Customer_Group__c),
		"RESELLERS",1,
		"DEALERS",1,
		0
	)=1, 
	CASE( 
		$Profile.Name,
		"Key Account Manager NL", 1,
		"Rayon Accountmanager NL", 1,
		"Manager Sales NL",1,
		0
	)=1
)

 
This was selected as the best answer
Marlon BandhoeMarlon Bandhoe
Hi Amith,

Yeah i don't want the Specific Profiles to change to values when the Value: "Dealers", "Resellers" are select i will give your formula a try thanks. I will try and get back at you.
Marlon BandhoeMarlon Bandhoe
Amit,

It worked! Thanks for your help.
Amit SinghAmit Singh
Cheers :)