Salesforce Fact #157 | Id accepts NULL, not blank
Id type in Salesforce does not consider any blank value, it accepts only NULL.
If we have a function which accepts Id type parameter, then if due to some incorrect code logic, the blank value is passed it will throw error. Similar thing goes for a function which returns an Id, if we cannot return a valid Id, we need to make sure we are returning NULL, and not blank by mistake.
Attached are the screenshots.
Comments
Post a Comment