You need to sign in to do that
Don't have an account?
Varun Sachdeva 29
Validation rule to link Opportunity stage to Custom object
I have created a custom object for attachment with Opportunity as the parent. I want to link opportunity stage to this object. One should be able to mark the stage as closed won only when the custom object has some attachment. Need a validation rule for this. Have tried this script
AND(ISPICKVAL(StageName,"Closed Won"), ISBLANK($ObjectType.OpportunityAttachment__c.Fields.Name))
It shows no syntax error, but does not function while marking the stage as closed won
AND(ISPICKVAL(StageName,"Closed Won"), ISBLANK($ObjectType.OpportunityAttachment__c.Fields.Name))
It shows no syntax error, but does not function while marking the stage as closed won
You can't validate whether a Opportunity is having child records or not using validation rules. You need to write a Trigger on opportunity with before update and then query the attachments related to each Opp and then verify if its greater than 0 allow to update else throw error.
Hope this helps ...!!!
Thanks for the reply. We have a similar validation rule requiring opportunity to have product line item in order for it to be marked closed won. Any reason why cant the same be applied for the custom object.