Search code examples
c#sdkinteropquickbooks

How to delete Quickbook Invoice using SDK


We are using Interop.QBFC14 SDK to delete invoice.

IMsgSetRequest requestMsgSet = sessionHelper.GetMsgSetRequest();
                
ITxnDel txnDelRq = requestMsgSet.AppendTxnDelRq();

txnDelRq.TxnDelType.SetValue(ENTxnDelType.tdtInvoice);

txnDelRq.TxnID.SetValue("<<InvoiceNo>>");

But the response from SDK is

Object "[[InvoiceNo]]" specified in the request cannot be found.


Solution

  • IMsgSetRequest requestMsgSet = sessionHelper.GetMsgSetRequest();
                
    ITxnDel txnDelRq = requestMsgSet.AppendTxnDelRq();
    
    txnDelRq.TxnDelType.SetValue(ENTxnDelType.tdtInvoice);
    
    txnDelRq.TxnID.SetValue(TxnID);
    
    Pass TxnID