Adding contacts and contact groups xero-php-oauth2

221 Views Asked by At

I have recently started using your xero-php-oauth2 with the example code given, I am working through all and have had success

I have posted contacts into Xero with

$contact->setName($rs->bName)
            ->setFirstName($rs->fName)
            ->setLastName($rs->lName)
            ->setContactNumber($rs->numTo)
            ->setAccountNumber($rs->account_number)
            ->setAddresses($address)
            ->setIsSupplier(true)
            ->setDefaultCurrency($rs->currency)
            ->setPhones($phones)
            ->setEmailAddress($rs->email); 

All works well but now if I want to getContacts() with filter it is extremely difficult (stored as string not int) So if I set the filter:

$where='ContactNumber >= "10" AND ContactNumber <= "20"';

Returns 1,10,100,1000 etc; Is there a better way to do this without making an OR OR OR filter?

Also I can I add ContactGroup when creating Contact(Above), I have failed in every attempt, I can only do it once contact has been added?

Any help as always is appreciated! Many thanks

Barry

0

There are 0 best solutions below