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
Aaron HuangAaron Huang 

Validation rule under opportunity product to validate against a defined value under account

I tried to create a validation rule for a field called "Jurisdiction" under opportunity product to validate against another field also called "Jurisdiction" under Account to see if Product Jurisdiction contains Account Jurisdiction.

A quick example below:
Account name AH Test is located in Nevada.
When trying to add product, for example, DARK SAMURAI which is not approved to sell in any Jurisdiction (N/A) to an opportunity under AH Test, show a message to account owner that DARK SAMURAI is not approved yet in Nevada. But still have the option for account owner to add to the opportunity.

Salesforce support told me this requires out-of-scope apex coding because it involves 3 objects: Account, Opportunity, Opportunity Product.

Any feedback is appreciated.
SonamSonam (Salesforce Developers) 
Yes, this would be not possible using the out-of-box functionality, however, you can acheive this through a trigger on opportunity Product.

Following thread shows a sample code snippet where a trigger is used a validation, please go through:https://developer.salesforce.com/forums/ForumsMain?id=906F00000008wqZIAQ