+ Start a Discussion
force shahidforce shahid 

issue with process builder and validation rule

I created process builder on order object. When order is activated then the related opportunity of order stage becomes closed won.

And I created  validation rule , when opportunity stage is closed won , then no one can edit this opportunity.

When I am trying to activate the order , validation rule will fire and display validation error message .
How to fix this issue ? Any idea ?
Thanks in advance,
Shahid.
Waqar Hussain SFWaqar Hussain SF
Create a checkbox field on the opportunity (don't add this field on the page layout), Lets name it Do not Fire Validation

Then in your validation rule, add a condition that If this If this checkbox field is true then do not run the validation rule.

In your process builder while you are updating the opportunity stage to closed won, also update this checkbox field to true.

Hope this make sense.
kamala swarnalathakamala swarnalatha
Hi,
May I know your code to help you?

Thanks,
K.kamala
sowmya Inturi 9sowmya Inturi 9
Hi,
Try using this formula in validation rule,

 ISPICKVAL(PRIORVALUE(StageName),'Closed Won')


Thanks,
Sowmya
kamala swarnalathakamala swarnalatha
Hi,

You have to create the process builder on order object. When order is activated then the related opportunity of order stage becomes closed won and Create a checkbox field on the opportunity Do not Fire Validation to be checked using update the field action in process builder.

Then try using this formula in validation rule,

Do not Fire Validation = True && NOT( ISPICKVAL( StageName , "Closed Won") )

It will be worked fine.Hope this helps!

Thanks,
K.Kamala,Jenefa
Sweet Potato Tec.