Joined: 03 Jun 2014
Location: United States
Online Status: Offline
Posts: 41
Topic: Formula handling Nulls? Posted: 08 Jul 2016 at 9:30am
Currently have the following formula:
if {Address.SubUnitTypeId} = 0 or IsNull({Address.SubUnitTypeId}) or IsNull({Address.SubUnit}) or IsNull({AddressSubUnit.Description}) then {Address.StreetOne} else if {Address.SubUnitTypeId} <> 0 then {Address.StreetOne} + ' ' + {@SubUnit}
however when the Nulls are True, it is NOT showing the Address.StreetOne I am unsure why?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 11 Jul 2016 at 3:17am
the NULL has to always be the first condition so in your first two conditions
"if {Address.SubUnitTypeId} = 0 or IsNull({Address.SubUnitTypeId})"
it hits the null and evaluates for = 0 first and then stops because it it does not know how to handle the null.
I find it easier to just use the option in the formula editor to 'use default values for nulls' then you can just use the "<> 0" or "= 0"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum