I have the following validation rules that should validate whether an Account has a 'complete' address when an opportunity is created for the account, and they're not validating and I'm not sure why. I have them listed under validation rules for opportunities.

Validation rule 1:

    ISPICKVAL(StageName, "Award Close 100%"), 
    (LEN( Account.Street_Address__c )=0), 
    (LEN( Account.City__c )=0))

Validation rule 2:

    ISPICKVAL(Account.Country_Code__c, "United States"), 
        LEN( Account.State_Province__c ) < 2, 
            "VI:WA:WV:WI:WY:AE:AA:AP", Account.State_Province__c ) 

We have old data in our system where some accounts don't have full addresses and we wanted to make sure the account stays up to date.

  • AND(ISPICKVAL(StageName, "Award Close 100%") Do you create opportunities that are closed? Maybe remove that criteria. Apr 22, 2015 at 18:10
  • Yeah, the criteria is met properly.. Thanks for the input. Apr 22, 2015 at 18:14
  • Might be that the cross object reference doesn't work in that context, in which case you would need to perform your validation in a before insert/before update trigger.
    – Adrian Larson
    Apr 22, 2015 at 21:14
  • shot in the dark - account.country_code__c is being tested for "United States" and not "US" ? When faced with these issues, I break down the validation rule into simpler bits (comment out clauses) and make sure each condition is working as expected; making adjustments as needed
    – cropredy
    Apr 23, 2015 at 1:26
  • How about creating two Checkbox formulas on the Opportunity object, with exactly the same formulas as the validation rules? Named 'Violates validation rule 1 (or 2)' Than you can see, for existing Opportunities, if those formulas work the way you expect them to. Apr 23, 2015 at 12:57

1 Answer 1


I have already experienced, that the child object (in your case the opportunity) does not yet have access to the parent object's (in your case the account's) fields by the time the validation rule is run. I would recommend using a simple before trigger to perform validation.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .