0

QBFC12.

I am querying for a Customer list in the desktop version of QB. From this I get an ICustomerRet object.

In the case where MiddleName has not been set these fail because the object is nothing:

  • if ICustomerRetObj.MiddleName.IsSet then ...
  • if ICustomerRetObj.MiddleName.IsEmpty then ...

This does work:

  • if ICustomerRetObj.MiddleName isnot nothing then ...

I am unable to find any documentation about IsSet and IsEmpty and they are not found in a search of QBSDK Programmers Guide.

What do these methods actually do?

Regards, Rick

Rick
  • 87
  • 1
  • 8

1 Answers1

0

The only time that I have ever used these functions is when doing an Add or Mod request. On a response, if there is no value for the field, then the object will be null. Since the object is null, you can't call the IsSet or IsEmpty function.

Here's what I do when checking for empty values:

if(iCustomerRet.FirstName != null) FirstName = iCustomerRet.FirstName.GetValue();
if(iCustomerRet.MiddleName != null) MiddleName = iCustomerRet.MiddleName.GetValue();
if(iCustomerRet.LastName != null) LastName = iCustomerRet.LastName.GetValue();

I think this may have to do with the fact that QBFC is a wrapper around the XML. Translating to an empty XLM node vs. setting it to empty may have something to do with these functions.

Hpjchobbes
  • 1,309
  • 1
  • 8
  • 11