Hello,
I want to write a VR to ensure users are following the Price book pricing maintained outside of Salesforce. Here is an example of fields and how the criteria work....I am not having much success on how to write this as a VR so it throws an error when the pricing selected at Opportunity Product level is incorrect.
Fields used, these all sit at Opportunity Product level.
Users - Number (populated via Flow)
Account Tier - Formula(Text)
Unit Price - Currency
This is the scenario where the user is advised to follow the pricing structure.
If
Account Tier = Tier 1
Users > 2
Users <6
Unit Price < 10000
Or
Account Tier = Tier 1
Users > 5
Users < 10
Unit Price < 20000
Or
Account Tier = Tier 2
Users > 2
Users <6
Unit Price < 35000
Account Tier = Tier 2
Users > 2
Users <6
Unit Price < 45000
Hello @Kinjal Patel,
Try this validation rule:
NOT(
OR(
AND(
Account_Tier__c = 'Tier 1',
Users__c > 2,
Users__c < 6,
UnitPrice >= 10000
),
AND(
Account_Tier__c = 'Tier 1',
Users__c > 5,
Users__c < 10,
UnitPrice >= 20000
),
AND(
Account_Tier__c = 'Tier 2',
Users__c > 2,
Users__c < 6,
UnitPrice >= 35000
),
AND(
Account_Tier__c = 'Tier 2',
Users__c > 5,
Users__c < 10,
UnitPrice >= 45000
)
)
)
This VR will throw an error when the Unit Price does not meet the criteria specified for each tier and user range.