Salesforce: Formula Blank Field Handling

When we create a formula field, at the bottom of the page, there will be a section called the ‘Blank Field Handling’ section.

 

Purpose: 

How do you want Salesforce to handle blank fields

 

Options Available:

  • Treat blank fields as zeroes – When the value inserted is blank or null, Salesforce will take it as a Zero (0).
  • Treat blank fields as blanks – When the value inserted is blank or null, Salesforce will take it as null or empty with no value at all.

 

Impact on Text Field Type:

Does not have much of impact when value received as blank. Whether if it should return blank or zero, when a blank text is received, Salesforce will by default return null value in the formula field.

 

Impact on Number or Currency Field Type:

It is important to choose wisely for a number or currency field because displaying as zero or blank effects the result of the formula.

ie: Create a formula field (Number_Formula__c) to add up two number field, Number_Field_1__c and Number_Field_2__c. Below shows the result when different choices is selected:

  • Treat blank value as zero:

1) Number_Field_1__c = 100

2) Number_Field_2__c = Null

3) Number_Formula__c = 100

  • Treat blank value as blank:

1) Number_Field_1__c = 100

2) Number_Field_2__c = Null

3) Number_Formula__c = Null

 

Therefore, it is important to choose the right handling method especially when the field involves with calculations of currencies or numbers.