Activity Forums Salesforce® Discussions What is the difference between null & isEmpty() in Salesforce?

  • What is the difference between null & isEmpty() in Salesforce?

    Posted by Deepak on June 22, 2020 at 1:23 PM

    What is the difference between null & isEmpty() in Salesforce?

    Anuj replied 6 years ago 2 Members · 1 Reply
  • 1 Reply
  • Anuj

    Member
    June 22, 2020 at 1:44 PM

    ISNULL determines if an expression is null (blank) then returns TRUE if it is. If the expression contains a value, then this function returns FALSE.

    isEmpty() as a condition, that generally means you’re making one or even two checks too many
    There are a few options to validate empty text fields in Apex: Use String. isBlank() method. This will return true if the text field is empty.

Log In to reply.