Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Basically, I want to have validation rules run when a step in an approval process is approved. I would like the rule to take into account which step triggered the rule, so that each step can have different requirements for approval. Is this possible? Thanks!

share|improve this question
    
unless you're trying to prevent the approver from picking incorrect values, theres no point in a validation rule to control the field updates by the process, because it will behave as configured. –  techtrekker Oct 15 '12 at 19:44
    
I don't think I followed your comment. For example, I want to make sure that the Operations team member does not 'Approve' their step in the process without having already input an Account Number into the appropriate field. Does that make sense? –  jackerman09 Oct 15 '12 at 19:46
    
okay i get it. so you want the approval process to stamp the step number on the record as an approval action. Then have a validation rule which says if Step 2 & AccountNumber is blank return an error. –  techtrekker Oct 15 '12 at 19:52
    
Right, that's exactly what I'm looking for. One of the issues that I'm trying to address in creating this process is to avoid people passing along incomplete documents, and now it looks like, even with this system, I can't prevent this from happening. –  jackerman09 Oct 15 '12 at 19:56
add comment

1 Answer 1

A custom field for Step Number, or the Status field you were referring to

So on each Approval Step, say Step 1 Have an Approval Action to update the field to Step 1, indicating that Step 1 is approved. Have a validation rule which summarises the data requirements for approval

OR(

AND(Text(Status__c) = 'Step 1', ISBLANK(AccountNumber__c)), // Step  1 Approval Check
AND(Text(Status__c) = 'Step 2', ISBLANK(SomeOtherField__c) // Step 2 Approval Check

)

This will return an error to the Approver in each step if they haven't supplied the required information before approving. (The validation rule will be triggered by the Process attempting a Field Update on Approval)

CORRECTION :
That might not work. login.salesforce.com/help/doc/en/approvals_considerations.htm says 'Field updates don’t evaluate custom validation rules on fields.' :/ So this may not be possible to do

Don't know if an addError via a trigger will be any different.

share|improve this answer
    
Ok, I'll try this and see if it works. Thanks. –  jackerman09 Oct 15 '12 at 19:58
    
That might not work. login.salesforce.com/help/doc/en/approvals_considerations.htm says 'Field updates don’t evaluate custom validation rules on fields.' :/ So this may not be possible to do. –  techtrekker Oct 15 '12 at 20:04
    
Unfortunately, after testing this, it did not prevent me from approving the step. If I try to edit the record, it does prevent me from saving it, but it is likely that if a user forgets to update this step, they will never edit the record, so the validation rule would be completely overlooked. –  jackerman09 Oct 15 '12 at 20:04
    
Thats correct, that is what the documentation seemed to suggest, as I've stated above. So I would think its not possible. Unless we try to see what a trigger does with an addError on the Record. –  techtrekker Oct 15 '12 at 20:06
    
Hmm, ok, I'm not sure if this project is worthy of a trigger at this point, but I'll explore it a little to see if anything comes of it. Thanks again! –  jackerman09 Oct 15 '12 at 20:09
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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