Problems with error parsing xml when adding NonInventoryItem

Michelle Martin
Michelle Martin Member Posts: 13
edited June 2020 in Reckon API
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:


Comments

  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited June 2020
    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
  • Michelle Martin
    Michelle Martin Member Posts: 13
    edited June 2020
    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>

  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited June 2020
    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
  • Michelle Martin
    Michelle Martin Member Posts: 13
    edited June 2020
    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!
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited June 2020
    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
  • Michelle Martin
    Michelle Martin Member Posts: 13
    edited June 2020
    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!
  • cosmic
    cosmic Reckon Developer Partner Posts: 1,073 ✭✭✭
    edited June 2020
    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 

    Cosmic Accounting Group

    Accountants and Tax Agents 22397009

  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited June 2020
    The workaround is to create a Custom field for Barcode and add the information via <DataExtRet>.

  • cosmic
    cosmic Reckon Developer Partner Posts: 1,073 ✭✭✭
    edited June 2020
    what about MParts and UOM , can we do same , Ifti

    Cosmic Accounting Group

    Accountants and Tax Agents 22397009