Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Email Address for Windows::Model::Employee #96

Open
fabioelia opened this issue Aug 30, 2013 · 5 comments
Open

Email Address for Windows::Model::Employee #96

fabioelia opened this issue Aug 30, 2013 · 5 comments

Comments

@fabioelia
Copy link
Contributor

Using The following example of code does not work. Complains about null being entered on the Quickbooks Database for the email.

IntuitRequestException (cannot insert NULL into ("ESB"."EMAIL_API"."LABEL_NAME_MAP")):

Have has since ignored using email, and continued along

  • employee.type_of = "Person"
  • employee.name = "Bugs Bunny"
  • employee.given_name = "Bugs"
  • employee.family_name = "Bunny"
  • email = Quickeebooks::Windows::Model::Email.new
  • email.address = "[email protected]"
  • email.tag = "Business"
  • employee.email = email
  • address = Quickeebooks::Windows::Model::Address.new
  • address.tag = "Billing"
  • address.line1 = "123 Main St."
  • address.city = "San Francisco"
  • address.country_sub_division_code = "CA"
  • address.postal_code = "94117"
  • address.country = "USA"
  • employee.address = address
@DexterTheDragon
Copy link
Contributor

The error implies that your email.tag isn't set to either "Home" or "Business".

@ruckus
Copy link
Owner

ruckus commented Aug 30, 2013

Weird, because your XML looks "OK" - from what you have below it generates this XML:

Person Bugs Bunny 123 Main St. San Francisco USA CA 94117 Billing [email protected] Business Bugs Bunny

And your Email#Tag is correct with "Business".

On Aug 30, 2013, at 2:19 PM, Fabio Elia [email protected] wrote:

Using The following example of code does not work. Complains about null being entered on the Quickbooks Database for the email.

IntuitRequestException (cannot insert NULL into ("ESB"."EMAIL_API"."LABEL_NAME_MAP")):

Have has since ignored using email, and continued along

• employee.type_of = "Person"
• employee.name = "Bugs Bunny"
• employee.given_name = "Bugs"
• employee.family_name = "Bunny"
• email = Quickeebooks::Windows::Model::Email.new
• email.address = "[email protected]"
• email.tag = "Business"
• employee.email = email
• address = Quickeebooks::Windows::Model::Address.new
• address.tag = "Billing"
• address.line1 = "123 Main St."
• address.city = "San Francisco"
• address.country_sub_division_code = "CA"
• address.postal_code = "94117"
• address.country = "USA"
• employee.address = address

Reply to this email directly or view it on GitHub.

@ruckus
Copy link
Owner

ruckus commented Aug 30, 2013

I realize the error text has "Email" in it, but according to the docs:

https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/employee

A Phone element is required. What happens if you specify a Phone element - does the request succeed?

@DexterTheDragon
Copy link
Contributor

Yeah the docs say that a phone, email, and address are required but I create mine without any of them and they work fine. The code lines @fabioelia posted are from the spec file. That's why I figured based on the error message that his code may have been specifying a different email.tag.

@fabioelia
Copy link
Contributor Author

Thanks for the guidance! @DexterTheDragon @ruckus
So adding phone worked but I had to modify the employee model.

windows employee pull request
Still learning the repository and the quickbooks api guide. Im not sure why employee has to have one phone number? Would have assumed it could have multiple phone objects [Quickeebooks::Windows::Model::Phone] but that doesn't work. Maybe its somewhere in the quickbooks api?

Output of xml:

<Employee>
<TypeOf>Person</TypeOf>
<Name>Test</Name>
<Address>
<Line1>123 Test Ave</Line1>
<City>Test City</City>
<Country>United States</Country>
<CountrySubDivisionCode>Massachusetts</CountrySubDivisionCode>
<PostalCode>12345</PostalCode>
<Tag>Billing</Tag>
</Address>
<Phone>
<DeviceType>Mobile</DeviceType>
<FreeFormNumber>555-333-2222</FreeFormNumber>
<Tag>Mobile</Tag>
</Phone>
<Email>
<Address>[email protected]</Address>
<Tag>Business</Tag>
</Email>
<GivenName>test</GivenName>
<FamilyName>test</FamilyName>
</Employee>

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

No branches or pull requests

3 participants