Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Contact Person only add the first #572

Open
djvmax opened this issue May 5, 2019 · 0 comments
Open

Add Contact Person only add the first #572

djvmax opened this issue May 5, 2019 · 0 comments

Comments

@djvmax
Copy link

djvmax commented May 5, 2019

Hi,

I try to create new contact person to a contact existing and when there is not any contact person is good the process is adding the new contact person but if I have a contact person added and try to add a new one the existing contact person data is update and I loose the old one.

To do this I use this code:

                $contactPerson = new \XeroPHP\Models\Accounting\Contact\ContactPerson($xero);
                $contactPerson->setFirstName($row->first_name);
                $contactPerson->setLastName($row->last_name);
                $contactPerson->setEmailAddress($row->email);
                $contactPerson->setIncludeInEmail(true);
                $contact->addContactPerson($contactPerson);
                $contact->save();

Can you help me please?

Best Regard
Vmax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant