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
Phillip Moseley 2Phillip Moseley 2 

Validation rule is showing error for profile anytime opportunity is edited instead of just on the fields within the fomula

I have the following validation rule that is working when Primary Partner field has a value it is showing error to update Partner Detail field, however the error is also being given anytime the Opportunity is edited. I need the formula below to only show error when the Primary Technology Partner field has a value and the Partner Type field is blank. Does anyone have any suggestions on how to make this error show just based off the two fields in formula and not when the opportunity is edited. Thanks.
 
AND(
OR(
INCLUDES(Primary_Technology_Partner_Involved__c, "Achilles"),
INCLUDES(Primary_Technology_Partner_Involved__c, "Adopt - Pendo"),
INCLUDES(Primary_Technology_Partner_Involved__c, "Bureau Van Dijk"),
INCLUDES(Primary_Technology_Partner_Involved__c, "Commerce Decisions"),
ISBLANK(TEXT(Partner_Type__c))),
OR(
$Profile.Name = 'Jaggaer Sales Partner Group',
$Profile.Name = 'Jaggaer Sales',
$Profile.Name = 'Sales Salesforce Super User' ))
Best Answer chosen by Phillip Moseley 2
Maharajan CMaharajan C
Sorry it's my mistake.
 
AND( 
	ISBLANK(TEXT(Partner_Type__c)),
	NOT(ISBLANK(Primary_Technology_Partner_Involved__c)),
	OR( 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Achilles"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Adopt - Pendo"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Bureau Van Dijk"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Commerce Decisions")
	), 
	OR( 
		$Profile.Name = 'Jaggaer Sales Partner Group', 
		$Profile.Name = 'Jaggaer Sales', 
		$Profile.Name = 'Sales Salesforce Super User' 
	)
)

Thanks,
Maharajan.C

All Answers

Maharajan CMaharajan C
Hi Phillip,

Can you please try the below formula:
 
AND(
	ISBLANK(TEXT(Partner_Type__c)),
	OR(
		INCLUDES(Primary_Technology_Partner_Involved__c, "Achilles"),
		INCLUDES(Primary_Technology_Partner_Involved__c, "Adopt - Pendo"),
		INCLUDES(Primary_Technology_Partner_Involved__c, "Bureau Van Dijk"),
		INCLUDES(Primary_Technology_Partner_Involved__c, "Commerce Decisions"),
	),
	OR(
		$Profile.Name = 'Jaggaer Sales Partner Group',
		$Profile.Name = 'Jaggaer Sales',
		$Profile.Name = 'Sales Salesforce Super User' 
	)
)

Thanks,
Maharajan.C
Phillip Moseley 2Phillip Moseley 2
Hi Maharaja, Thanks for your response. Unfortunately I’m still getting the error anytime the opportunity is edited using the updated formula below.
Maharajan CMaharajan C
Are sure the same validation rule is still firing... I hope you filled the value to Partner_Type__c... Please check is there any simillar kind of vaildation rule or trigger validation is there in your org...

Thanks,
Maharajan.C
Phillip Moseley 2Phillip Moseley 2
Hi Maharaja, I appreciate your help trying to get this resolved. I added the formula that you added and I’m getting the error in the attached screenshot. Here is formula you suggested. Reply: Hi Phillip, Can you please try the below formula: AND( ISBLANK(TEXT(Partner_Type__c)), OR( INCLUDES(Primary_Technology_Partner_Involved__c, "Achilles"), INCLUDES(Primary_Technology_Partner_Involved__c, "Adopt - Pendo"), INCLUDES(Primary_Technology_Partner_Involved__c, "Bureau Van Dijk"), INCLUDES(Primary_Technology_Partner_Involved__c, "Commerce Decisions"), ), OR( $Profile.Name = 'Jaggaer Sales Partner Group', $Profile.Name = 'Jaggaer Sales', $Profile.Name = 'Sales Salesforce Super User' ) ) Thanks, Maharajan.C
Maharajan CMaharajan C
Try the below formula in your validation rule:
 
AND( 
	ISBLANK(TEXT(Partner_Type__c)),
	NOT(ISBLANK(BorregoStrategicObjectives__c)),
	OR( 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Achilles"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Adopt - Pendo"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Bureau Van Dijk"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Commerce Decisions")
	), 
	OR( 
		$Profile.Name = 'Jaggaer Sales Partner Group', 
		$Profile.Name = 'Jaggaer Sales', 
		$Profile.Name = 'Sales Salesforce Super User' 
	)
)

Thanks,
Maharajan.C
Phillip Moseley 2Phillip Moseley 2
Sorry for the back and forth. Just curious why the line below is in the formula. This field is not in our instance of salesforce or part of the original formula. NOT(ISBLANK(BorregoStrategicObjectives__c Thanks,
Maharajan CMaharajan C
Sorry it's my mistake.
 
AND( 
	ISBLANK(TEXT(Partner_Type__c)),
	NOT(ISBLANK(Primary_Technology_Partner_Involved__c)),
	OR( 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Achilles"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Adopt - Pendo"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Bureau Van Dijk"), 
		INCLUDES(Primary_Technology_Partner_Involved__c, "Commerce Decisions")
	), 
	OR( 
		$Profile.Name = 'Jaggaer Sales Partner Group', 
		$Profile.Name = 'Jaggaer Sales', 
		$Profile.Name = 'Sales Salesforce Super User' 
	)
)

Thanks,
Maharajan.C
This was selected as the best answer
AnkaiahAnkaiah (Salesforce Developers) 
Hi Phillip,

As per your description, need throw an error when Primary_Technology_Partner_Involved__c field have any value & Partner_Type__c field have empty..
If my understanding is corrent then use the below formula.
 
AND( 
	ISBLANK(Partner_Type__c),
	NOT(ISBLANK(Primary_Technology_Partner_Involved__c)),
	OR( 
		$Profile.Name = 'Jaggaer Sales Partner Group', 
		$Profile.Name = 'Jaggaer Sales', 
		$Profile.Name = 'Sales Salesforce Super User' 
	)
)

If this helps, Please mark it as best answer.

Regards,
Ankaiah Bandi
 
Phillip Moseley 2Phillip Moseley 2
Thanks for all your help Maharaja. This worked as expected and I have chosen this as best answer on request. Thanks again for the help! Phillip