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
SSimionSSimion 

Validation Rule stops Process Builder to fire

Hi All,

I have a Process Builder and a Validation Rule on the Opportunity Object.

The Validation Rule is meant to stop the users from modifying an Opportunity once Closed Won, apart from Admins.
 
AND
(ISPICKVAL(PRIORVALUE(StageName),"Closed Won"), CASE($Profile.Name, 
"ProfileName1",1, 
"ProfileName2",1, 
0)=0 
)

And the Process Builder is checking if "[Opportunity].IsClosed = TRUE, and updates the Close Date = TODAY().

Error message:
 
> The flow tried to update these records: null. This error occurred:
> FIELD_CUSTOM_VALIDATION_EXCEPTION


Both the Process Builder and the Validation Rule work fine, but activated separately.

Is there a way to stop the users from modifying the Closed Won Opportunity, but allow the process to change the Close Date for the users?


Thanks.
Anthony McDougaldAnthony McDougald
Hello Ssimion,
Hope that your day is off to an amazing start. We've edited your validation rule to meet your criteria. Please test and report back if you have any problems. Hope this helps and may God bless you abundantly.
AND
(ISPICKVAL(PRIORVALUE(StageName),"Closed Won"),
$Profile.Name <> 'System Administrator'
)

Best Regards,
Anthony McDougald 
Maharajan CMaharajan C
Try the belows:

AND( 
TEXT(StageName)== "Closed Won", 
$Profile.Name <> 'System Administrator'
)

Thanks,
Maharajan.C
SSimionSSimion
Hello Anthony,

I hope you're well and thanks for coming back to me.

I have amended my VR as per your suggestion, but unfortunately, the process still fails.

Thanks.
SSimionSSimion
Hi Maharajan,

Thanks a lot for your suggestion. I have also tried yours, but unfortunately, I am unable to Closed Won the Opportunity.

Thanks.
Anthony McDougaldAnthony McDougald
Good Evening Ssimion,
Hope that your day is off to an amazing start. Apparently, this is an issue that occurs and will need a work around. For a Process Builder, you would need a custom field to use to bypass the VR. However, we would recommend using APEX as this can automate your solutions while fulfilling the needs of the VR. Hope this helps and may God bless you abundantly.
Best Regards,
Anthony McDougald
SSimionSSimion
Hi Anthony,

Thanks for your reply. I have managed to resolve this now.

Thanks a lot.
Kent FidlerKent Fidler
Hi SSimon,
I'm having a similiar issue. How did you resolve this issue. 

Thanks!