0

I've got a validation rule that won't work.

IF(AND( ISPICKVAL( Type , "Project scoping"), Account.TotalAvailableCredits__c =0 ),TRUE,FALSE)

Essentially, it's supposed to display an error message if the opportunity type is equal to "Project scoping" and the available credits (TotalAvailableCredits__c =0) on the associated account is equal to zero.

1 Answer 1

1

Are you sure the TotalAvailableCredits on the related Account equals 0 and not null? Also, have you confirmed that the Validation Rule is active?

I tested it on a sandbox and it worked as expected.

Edit: After reading you comment I changed it in order to apply for both null/0 values.

IF(AND( ISPICKVAL( Type , "Projectscoping"),                             
     OR( ISBLANK(Account.TotalAvailableCredits__c),                          
      Account.TotalAvailableCredits__c =0))    
                                     ,TRUE,
FALSE)                                                                      

Best regards!

3
  • Thanks for the reply, yes the rule is active and the format of the TotalAvailableCredits is a number format, hence not null - or am I wrong? Sep 4, 2020 at 13:54
  • You're wrong indeed @JoachimMeulengracht :) If the value of the number field is null it will not be treated as zero. I tested for both values and the VR does not fire when the TotalAvailableCredits field is null. Sep 4, 2020 at 14:29
  • 2
    IF(expression, true, false) is the same as expression Sep 8, 2020 at 7:49

You must log in to answer this question.

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