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
Chandra SekaranChandra Sekaran 

How to exclude the master opportunity in Validation rule?

Hi,
I need to check the status of opportunities except the master opportunities.
How can we identify the master opportunities in validate rule.Could you please provide sample validation rule for excluding master opportunities.
Thanks in Advance.

Thanks.
Chandra
Best Answer chosen by Chandra Sekaran
James LoghryJames Loghry

How are you tracking whether or not an Opportunity is a master opportunity?  Through a lookup relationship or a record type probably?  If so, it's just a matter of adding criteria to your validation rule.  E.g. if it's the a lookup relationship you could do something like:

 

NOT(ISBLANK(ParentOpportunity__c))

Or if it's a record type, you could do something like
 
RecordType.DeveloperName <> 'Master'

Keep in mind that a validation rule returns TRUE for the ERROR condition.

Hope that helps.

All Answers

James LoghryJames Loghry

How are you tracking whether or not an Opportunity is a master opportunity?  Through a lookup relationship or a record type probably?  If so, it's just a matter of adding criteria to your validation rule.  E.g. if it's the a lookup relationship you could do something like:

 

NOT(ISBLANK(ParentOpportunity__c))

Or if it's a record type, you could do something like
 
RecordType.DeveloperName <> 'Master'

Keep in mind that a validation rule returns TRUE for the ERROR condition.

Hope that helps.
This was selected as the best answer
Chandra SekaranChandra Sekaran
Thanks James.Appreciated your help...