You need to sign in to do that
Don't have an account?
I have a requirement where I have to create a validation rule - There is an object opportunity (Master) and a custom object
I have a requirement where I have to create a validation rule - There is an object opportunity (Master) and a custom object (Detail). Whenever stage is Qualification on opportunity then I have to lock 3 fields from editing Field 1 , Field 2 and Field 3. Field 1 is on opportunity object and Field 2 and 3 are on custom object.
I created the validation rule on custom object -
AND( ISPICKVAL(ISPRIORVAL( Opportunity__r.StageName) , 'Qualification') ,
OR(
ISCHANGED( Opportunity__r.Field1 )
ISCHANGED( Field2 ) ,
ISCHANGED( Field3 ),
)
)
I am getting this error -
The PRIORVALUE function cannot reference the field (ISPRIORVAL( Opportunity__r.StageName) validation rule.
Also, We do not have any lookup on opportunity to custom object so I had to create the validation rule on Custom Object.
One small correction I forgot to add.
You cannot use Priorvalue on releted objects.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
You may have to write two validation rules for this. One on Opportunity object and other on the child object. The validation should not use ISPRIORVAL in child object because we cannot channge the opportunity and the child object at same time. So the validation rule would be as below.
On Opportunity:
On custom object.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
The PRIORVALUE function cannot reference the Opportunity__r.StageName field.
This is my validation rule on Custom Object
AND( ISPICKVAL( PRIORVALUE( Opportunity__r.StageName), 'Qualification'),
OR(
ISCHANGED( Field2 ),
ISCHANGED( Field3 )
)
)
One small correction I forgot to add.
You cannot use Priorvalue on releted objects.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
It works !
Thank you so much Sai Praveen.