+ Start a Discussion
mjohnson-TICmjohnson-TIC 

Formula Field Bug

I found something very odd  this morning in the evaluation of number formula fields. Here is a simple formula example where it is returning the incorrect value.

 

IF(Number_Field__c != null, 1, 2)

 

For some reason entering a number in Formula_Field__c will NOT cause the expected 1 to be returned on this record but rather 2. That means even on a record where a value is entered for Number_Field__c, the expressions Number_Field__c != null returns false meaning the system recognizes this as Formula_Field__c =  null?

mjohnson-TICmjohnson-TIC

The workaround for this issue is change the expression to

 

IF(NOT(ISNULL(Number_Field__c)), 1, 2)

 

I thought everyone would like to be aware of this issue.

SteveMo__cSteveMo__c

Try using something like:  

IF(ISBLANK(NumberField__c), 2, 1)

Also make sure you select "Treat blank fields as blanks" 

 

SteveMo__cSteveMo__c

are you all set or do you still need help?

mjohnson-TICmjohnson-TIC

I came up with a workaround, just thought people would like to know number formula fields do not evaluate IF(Number_Field__c != null) correctly - thanks.