Search code examples
vb.netsdkdesktopquickbooks

QuickBooks SDK How Do you Delete an Inventory Adjustment Based on RefNumber


I'm just starting with the QuickBooks SDK and am trying to delete an inventory adjustment based on the reference number and cannot quite figure out how to do it based on the documentation.

The request I'm sending is as follows:

<?xml version="1.0" encoding="utf-8"?>          
<?qbxml version="2.1"?>         
<QBXML>         
    <QBXMLMsgsRq onError="stopOnError">     
        <TxnDelRs>  
            <TxnDelType>InventoryAdjustment</TxnDelType>
            <RefNumber>MyRefNumber</RefNumber>
        </TxnDelRs> 
    </QBXMLMsgsRq>      
</QBXML>            

I'm getting a return error message that it cannot parse the XML string, so I'm assuming I'm missing something because the XML is valid.

Also... I have a few other quick questions if I may indulge.

  1. When using qbXML, I have to use version 2.0 or 2.1. If I use 15.0 as they show in their examples, my code fails. This doesn't make sense because I downloaded the 15.0 version of the SDK
  2. I noticed there are often two different tags as in "< TxnDelRq >" and "< TxnDelRs >". What is the difference between the "Rq" and "Rs" version of the tags.

Solution

  • I have not tested this yet, but I am also interested in doing this. This is my guess as to what the request needs to look like deleting by the quick books id.

    <?xml version="1.0" encoding="utf-8"?><?qbxml version="13.0"?>
    <QBXML>
        <QBXMLMsgsRq onError="stopOnError">
            <TxnDelRq>
                <TxnDelType>InventoryAdjustment</TxnDelType>
                <TxnID>QuickBooksIdHere</TxnID>
            </TxnDelRq>
        </QBXMLMsgsRq>
    </QBXML>
    

    In general Rq tags are always for Requests to Quickbooks, and Rs tags always come back from Quickbooks as Responses. In your case you will definately always want Rq and you read back Rs.

    Something I always forget about but find useful is this qbSDK online tool to find all the objects and property names https://static.developer.intuit.com/qbSDK-current/common/newosr/index.html

    I do not see RefNumber on the object, only TxnDelType and TxnID appear to be on this object.

    Image of SDK object