0

And by randomly I mean unidentified by me at least, on a 1 out of 10 rate approx... but if I log in with a different user (Even with the same profile, System Administrator) chances that it will fail or run are, again, random.

We have two record types on accounts, "rt1" is a person account and "rt2" is a standard account.

And, the following validation rule:

IF( $RecordType.Name = "rt1",   
IF (  CASE( [a comparison of a field populated only in the rt1 layout against a formula field based on other fields populated in that layout] ) , FALSE, TRUE )   
,IF (  CASE( [a comparison of a field populated only in the rt2 layout against a formula field based on other fields populated in that layout] ) , FALSE, TRUE )  )

That sometimes will run OK and sometimes will fail as it tries to compare the fields and formulas populated on the other record type.

I really have no means to recreate this, but it happens (randomly) in manual account creations through the Salesforce Interface, the DataLoader and even on API integrations.

A quick and dirty solution has been disable/enable but that's far from ideal.

1 Answer 1

1

I think, not only checking the recordtype.name you could add IsPersonAccount = true/false in the validation to make sure respective fields are available in either person account or business account.

6
  • Hahaha this is one of those moments when the impostor syndrome hits hard... I just changed our validation rule to consider only the IsPersonAccount vaule, ignoring the recordtype, will try it for a couple days and then get back to approve this. Thanks!
    – FuuRe
    Jun 10, 2016 at 17:31
  • Just tried this, no dice, now it always fails... could it be the formula fields not populated before the validation rule evaluation? a Chain of execution mistake in my side?
    – FuuRe
    Jun 10, 2016 at 17:37
  • Formula field is populated after saving the record. You take the logic of the formula field and introduce that in validation rule properly. Jun 10, 2016 at 17:49
  • But that won't work then, as the validation rule runs before saving the object, or am i wrong?
    – FuuRe
    Jun 10, 2016 at 18:20
  • what I mean say put the proper logic in the validation rule, which can check whether is the partner account or not based on the formula logic. Jun 10, 2016 at 19:09

You must log in to answer this question.

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