Open fabioelia opened 11 years ago
The error implies that your email.tag isn't set to either "Home" or "Business".
Weird, because your XML looks "OK" - from what you have below it generates this XML:
And your Email#Tag is correct with "Business".
On Aug 30, 2013, at 2:19 PM, Fabio Elia notifications@github.com 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 = "foo@bar.com" • 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.
I realize the error text has "Email" in it, but according to the docs:
A Phone
element is required. What happens if you specify a Phone element - does the request succeed?
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.
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>test@test.com</Address>
<Tag>Business</Tag>
</Email>
<GivenName>test</GivenName>
<FamilyName>test</FamilyName>
</Employee>
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