Search code examples
c#.netdesktopquickbooks

C# Quickbooks Desktop Integration issue


We use the QB .NET SDK to integrate to QB Desktop. We've been doing this for years with a lot of success but are running into an issue when we are now trying to do an ItemReceipt transaction with serial numbers (We've not done serial numbers with QB before). We are receiving an:

2022/11/07 09:38:39>!QuickBooks found an error when parsing the provided XML text stream. at Interop.QBFC13.QBSessionManagerClass.DoRequests(IMsgSetRequest request) at DCCQBFuncs.DCCQB.send_message_to_qb() in DCCQB.cs:line 413 QBXMLRP2.RequestProcessor.2

That's all we get and we're not sure how to troubleshoot this since it doesn't look like we have access to the XML text stream in the SDK???

As a note ... when we take out the serial number ... all works well and yes this is QB Enterprise (Only edition that allows serial numbers) and serialization is enabled.

Line Item Code:

                //SCROLL THROUGH ALL ITEMS
            for (c = 0; c < part_numbers.Length; c++)
            {
                //CREATE A NEW LINE ITEM
                IORItemLineAdd lineitem = itemReceiptAddrq.ORItemLineAddList.Append();
                
                //SET ITEM CODE
                lineitem.ItemLineAdd.ItemRef.FullName.SetValue(part_numbers[c]);

                //IF WE HAVE SERIAL NUMBERS IN DATA THEN ADD HERE
                if (serial_numbers != null && serial_numbers.Length == part_numbers.Length)
                {
                    lineitem.ItemLineAdd.ORSerialLotNumber.SerialNumber.SetValue(serial_numbers[c]);
                }
                
                //ADD QUANTITY (REQUIRED)
                lineitem.ItemLineAdd.Quantity.SetValue(Double.Parse(quantities[c]));
            }

Thanks in advance

Marshall

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="6.0"?>
<QBXML>
<QBXMLMsgsRq onError = "continueOnError">
<ItemReceiptAddRq requestID = "0">
<ItemReceiptAdd>
<VendorRef>
<FullName>GPCTX</FullName>
</VendorRef>
<TxnDate>2022-11-08</TxnDate>
<RefNumber>NA</RefNumber>
<Memo>Receive from DCC IdyllicWMS Mobile Scanner</Memo>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004441</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004442</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004443</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004444</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004445</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004446</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004447</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004448</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004449</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004450</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004451</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004452</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004453</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004454</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004455</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004456</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004457</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004458</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004459</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004460</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004461</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004462</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004463</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004464</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004465</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004466</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004467</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004468</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004469</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004470</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004471</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004472</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004473</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004474</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004475</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004476</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004477</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004478</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004479</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004480</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004481</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004482</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004483</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004484</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004485</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004486</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004487</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004488</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004489</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
<ItemLineAdd>
<ItemRef>
<FullName>GPSB100</FullName>
</ItemRef>
<SerialNumber>0004490</SerialNumber>
<Quantity>1</Quantity>
</ItemLineAdd>
</ItemReceiptAdd>
</ItemReceiptAddRq>
</QBXMLMsgsRq>
</QBXML>

The above is the QB msgreq object toXML()

Thanks again


Solution

  • Chatted with Intuit on this and we were using the wrong version of QBXML to utilize serialization (Advanced Inventory). We need to move from QMXML13 to QBXML16.

    So in your code switch from top line to the bottom:

    //IMsgSetRequest imsr = qbs.CreateMsgSetRequest("US", 13, 0);
    
    IMsgSetRequest imsr = qbs.CreateMsgSetRequest("US", 16, 0);