Need to understand the difference between the usage of the rules APN_isEmpty and APN_isBlank

Hi,

Could someone clarify my doubt about difference between the usage of the rules APN_isEmpty   and APN_isBlank?

It would be good if a simple example is illustrated to make it simple to understand.

Thanks

Faisal

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Note that these are now largely unnecessary thanks to the new rules a!isNullOrEmpty() and a!isNotNullOrEmpty().

    As far as the two you've named - isBlank() is meant to determine whether a singular value is blank or null, while isEmpty() is meant to determine whether an array is completely empty.  For instance, an array with a single null is not considered empty, but would (iirc) show up as "blank".

    In the past though it was important to use these helper rules because there were some odd corner cases in the primitive rules that would break.  I don't remember many exact examples off the top of my head.  There was no direct way to do isEmpty() but by doing i.e. "length(ri!value) = 0", which itself fails when the value is null (instead of an empty set), so the helper rule handled null-checking.  The new functions I named at the top of this reply handle all that stuff pretty gracefully as far as I can tell.

Reply
  • 0
    Certified Lead Developer

    Note that these are now largely unnecessary thanks to the new rules a!isNullOrEmpty() and a!isNotNullOrEmpty().

    As far as the two you've named - isBlank() is meant to determine whether a singular value is blank or null, while isEmpty() is meant to determine whether an array is completely empty.  For instance, an array with a single null is not considered empty, but would (iirc) show up as "blank".

    In the past though it was important to use these helper rules because there were some odd corner cases in the primitive rules that would break.  I don't remember many exact examples off the top of my head.  There was no direct way to do isEmpty() but by doing i.e. "length(ri!value) = 0", which itself fails when the value is null (instead of an empty set), so the helper rule handled null-checking.  The new functions I named at the top of this reply handle all that stuff pretty gracefully as far as I can tell.

Children