4

I am having few validation rules on Opportunity, which should be fired when StageName is "Closed Won". An example validation rule is shown below

AND (
    ISPICKVAL(StageName, 'Closed Won'), ISBLANK( SomeOppField__c )
)

Opportunity > StageName = "Closed Won" happens after Approval > Field Update.

Somehow none of the validation rule fires after Opportunity is approved to closed won, my requirement is to block approval process, if data on opportunity is missing.

  • 1
    Closed-won and Approved are two entirely different things. If you're moving to Closed-won as part of your Approval process, then you likely need to separate the two. I don't believe you can have a validation rule fire on an approval process. That runs under an entirely different context than when a typical user saves a record. – crmprogdev Mar 8 '16 at 14:12
2

Workflow rule field updates (and hence by association, Approval Process field updates) don't fire Validation Rules. Per the doc

Because updates to records based on workflow rules don’t trigger validation rules, workflow rules can invalidate previously valid fields.

The reason for this is that time-based workflow actions and approval processes don't really have any mechanism for catching errors and asking the user to resolve them. So, SFDC takes the view that it is your job to make sure that you design workflows and approval processes to not run into errors (in your case, cueing the user to not even submit the record for approval if the object is in some state)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.