I am having trouble with a new Validation rule because it is conflicting with Flow. I am getting this error:
Error Occurred: The flow tried to update these records: 0064V00001LmbdtQAB. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Closed Opportunities cannot be edited. Please create a new Opportunity.. You can look up ExceptionCode values in the SOAP API Developer Guide.
Salesforce Error ID: 2064168760-169264 (-617785307)
Need: We want to prevent the editing of Closed Opportunities except for certain users through a Validation Rule.
Problem: My validation rule seems to be conflicting with a flow we have that changed the Close Date to Today() when an Opportunity is Closed Won/Lost
Here is the formula for my Opportunity Validation Rule
AND(
PRIORVALUE(IsClosed)=True,
$User.Alias<>"bbond",
$User.Alias<>"cburn",
$User.Alias<>"igend",
$User.Alias<>"jgord"
)
Here is the criteria for the Opportunity Flow. It updated the Close Date to Today when an Opportunity is Closed:
1- Trigger when a Record is Created or Updated
2- Condition Requirements - Formula Evaluates to True
3- Formula: AND( ISCHANGED({!$Record.StageName}), {!$Record.IsClosed}=TRUE )
Does anyone know what I am doing wrong?
Thank you!
$User
(and$Profile
and$Role
?). This official looking blog goes over setting it up and use in a validation rule.