Problems with error parsing xml when adding NonInventoryItem

  • 1
  • Problem
  • Updated 3 weeks ago
I'm trying to set up a test company file for my client and working out the best way to load list data. I'm on a trial developer's version of Reckon Accounts Enterprise Desktop 2020 and using the Intuit QuickBooks SDK to integrate with my 3rd party MS Access application.

I'm trying to set up a test company file for my client and working out the best way to load list data. I have set up most of the data using Import from Excel, but there are some fields that cannot seem to be loaded this way, e.g. BarCode in the Items list. So I'm using the QuickBooks SDK 6.0 qbXML to see if I can add items this way. But I'm getting a parse error.

Here is my request string:

<?xml version="1.0"?><?qbxml version="6.1"?><QBXML><QBXMLMsgsRq onError="stopOnError"><ItemNonInventoryAddRq requestID="3690"><Name>9330372000041</Name><BarCode><BarCodeValue>9330372000041</BarCodeValue></BarCode><IsActive>true</IsActive><IsTaxIncluded>false</IsTaxIncluded><SalesTaxCodeRef><FullName>GST</FullName></SalesTaxCodeRef><SalesAndPurchase><SalesDesc>Abelia grandiflora Nana 140mm</SalesDesc><SalesPrice>6</SalesPrice><IncomeAccountRef><FullName>Income:Sales:Flower & Plant Sales</FullName></IncomeAccountRef><PurchaseDesc>Abelia grandiflora Nana 140mm</PurchaseDesc><PurchaseCost>0</PurchaseCost><PurchaseTaxCodeRef><FullName>GST</FullName></PurchaseTaxCodeRef><ExpenseAccountRef><FullName>Cost of Sales:Purchases:Plants</FullName></ExpenseAccountRef></SalesAndPurchase></ItemNonInventoryAdd></ItemNonInventoryAddRq></QBXMLMsgsRq></QBXML>

And this is the error:


Photo of Michelle Martin

Michelle Martin

  • 146 Points 100 badge 2x thumb
  • frustrated

Posted 3 weeks ago

  • 1
Photo of Ifti

Ifti, Product Owner

  • 6,958 Points 5k badge 2x thumb
Hi Michelle,

Thank you for your post.

Barcode field isn't supported like this in the qbXML. Can you please try to post without the barcode data and let us how know it goes?

Thanks

Ifti
Photo of Michelle Martin

Michelle Martin

  • 146 Points 100 badge 2x thumb
Hi Ifti

I tried it again but without Barcode, but same error.


Here's the string I sent:

<?xml version="1.0"?><?qbxml version="6.1"?><QBXML><QBXMLMsgsRq onError="stopOnError"><ItemNonInventoryAddRq requestID="3690"><Name>9330372000041</Name><IsActive>true</IsActive><IsTaxIncluded>false</IsTaxIncluded><SalesTaxCodeRef><FullName>GST</FullName></SalesTaxCodeRef><SalesAndPurchase><SalesDesc>Abelia grandiflora Nana 140mm</SalesDesc><SalesPrice>6</SalesPrice><IncomeAccountRef><FullName>Income:Sales:Flower & Plant Sales</FullName></IncomeAccountRef><PurchaseDesc>Abelia grandiflora Nana 140mm</PurchaseDesc><PurchaseCost>0</PurchaseCost><PurchaseTaxCodeRef><FullName>GST</FullName></PurchaseTaxCodeRef><ExpenseAccountRef><FullName>Cost of Sales:Purchases:Plants</FullName></ExpenseAccountRef></SalesAndPurchase></ItemNonInventoryAdd></ItemNonInventoryAddRq></QBXMLMsgsRq></QBXML>

Photo of Ifti

Ifti, Product Owner

  • 6,958 Points 5k badge 2x thumb
Hi Michelle,

You're receiving the XML error due to having "&" in the <FullName> under <IncomeAccountRef>.

You will need to replace it with &amp; to overcome this.

Please give that a shot and let us know how you go.

Thanks

Ifti
Photo of Michelle Martin

Michelle Martin

  • 146 Points 100 badge 2x thumb
HI Ifti
I changed the Account name to "and" instead of "&" which was easier in the end. I was still getting the parse error, and discovered while querying an item that when I imported items from Excel, it did not set up the Purchase fields but returned SalesOrPurchase information. So then I tried adding a new item via qbXML with SalesAndPurchase fields, and that worked. But I get a parse error if I try and post SalesAndPurchase fields to the SalesOrPurchase items with ItemNonInventoryMod.
Do I have to delete those items and add them all through qbXML?

Thanks for you patience while I get a handle on all this!
Photo of Ifti

Ifti, Product Owner

  • 6,948 Points 5k badge 2x thumb
Hi Michelle,

No worries, happy to help.

I think it's better to create via qbXML as that gets rid of other issues and keeps it clean.

Thanks

Ifti
Photo of Michelle Martin

Michelle Martin

  • 146 Points 100 badge 2x thumb
I just had another look at the fine print (no really, the clear explanation) under ItemNonInventory and it states clearly that you can't change a SalesOrPurchase to SalesAndPurchase using a Mod Rq. And I also note that the BarCode element is in V12.0 and Reckon uses V6.1. Oh dear, humble pie!
i dont think the SDK has provison for Bar codes, Manufacturing Parts and UOM.
The Intuit version has as you stated . 
Ifti can reconfirm me 
Photo of Ifti

Ifti, Product Owner

  • 6,948 Points 5k badge 2x thumb
The workaround is to create a Custom field for Barcode and add the information via <DataExtRet>.

what about MParts and UOM , can we do same , Ifti