private static void OpenConnection(short majorVer,short minorVer,string companyPath) { SessionManager=new QBSessionManager(); //Create the message set request object to hold our request. RequestMsgSet=SessionManager.CreateMsgSetRequest("US",majorVer,minorVer); RequestMsgSet.Attributes.OnError=ENRqOnError.roeContinue; //Connect to QuickBooks and begin a session SessionManager.OpenConnection("","Open Dental"); ConnectionOpen=true; SessionManager.BeginSession(companyPath,ENOpenMode.omDontCare); SessionBegun=true; }
public void updateInvoice(string invoNumber) { OpenConnection(); majorVersionQB = Convert.ToInt16(QBFCLatestVersion(sessionManager)); requestMsgSet = getLatestMsgSetRequest(sessionManager); requestMsgSet = sessionManager.CreateMsgSetRequest(countryQB, majorVersionQB, minorVersionQB); requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue; IInvoiceQuery InvoiceQueryRq = requestMsgSet.AppendInvoiceQueryRq(); InvoiceQueryRq.ORInvoiceQuery.RefNumberList.Add(invoNumber); InvoiceQueryRq.OwnerIDList.Add("0"); InvoiceQueryRq.IncludeLineItems.SetValue(true); InvoiceQueryRq.IncludeLinkedTxns.SetValue(true); IInvoiceMod updateInvoiceModRq = requestMsgSet.AppendInvoiceModRq(); updateInvoiceModRq.Other.SetValue("hi"); updateInvoiceModRq.EditSequence.SetValue("1640351207"); IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet); IResponse response = responseMsgSet.ResponseList.GetAt(0); CloseConnection(); }
System.Runtime.InteropServices.COMException: 'This request is not supported in the specified qbXML version.'
majorVer
minorVer
CreateMsgSetRequest
RequestMsgSet=SessionManager.CreateMsgSetRequest("US",2,1);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)