here is an example of using the quickbooks SDK to add a new customer to quickbooks from a dbase table. before you can do this you must download and install the SDK from inuits website and make sure the the version for the sdk matches the quickbooks version you are using. The basic pattern works for all quickbooks activities.
sessionManager = New OleAutoClient("QBFC6.QBSessionManager")
sessionManager.OpenConnection("","appName") &&appName = your application
sessionManager.BeginSession("",2)
requestMsgSet = sessionManager.CreateMsgSetRequest("US",3,0) && 3 = sdk version
CustomerAddRq= requestMsgSet.AppendCustomerAddRq()
CustomerAddRq.Name.SetValue(_app.custform.notebook1.entryfieldcustname1.value)
CustomerAddRq.Contact.SetValue(_app.custform.notebook1.entryfieldcustcontact11.value)
CustomerAddRq.CompanyName.SetValue(_app.custform.notebook1.entryfieldcustname1.value)
CustomerAddRq.Phone.SetValue(_app.custform.notebook1.entryfieldcustphone11.value)
CustomerAddRq.AltPhone.SetValue(_app.custform.notebook1.entryfieldcustphone21.value)
CustomerAddRq.Email.SetValue(_app.custform.notebook1.entryfieldcustemail1.value)
CustomerAddRq.Fax.SetValue(_app.custform.notebook1.entryfieldcustfax1.value)
CustomerAddRq.AltContact.SetValue(_app.custform.notebook1.entryfieldcustcontact21.value)
CustomerAddRq.BillAddress.Addr1.SetValue(_app.custform.notebook1.entryfieldcustname1.value)
CustomerAddRq.BillAddress.Addr2.SetValue(_app.custform.notebook1.entryfieldcustAddress1.value)
CustomerAddRq.BillAddress.Addr3.SetValue(_app.custform.notebook1.entryfieldcustSuite1.value)
CustomerAddRq.BillAddress.City.SetValue(_app.custform.notebook1.entryfieldcustCity1.value)
CustomerAddRq.BillAddress.State.SetValue(_app.custform.notebook1.COMBOBOXCUSTSTATE1.value)
CustomerAddRq.BillAddress.PostalCode.SetValue(_app.custform.notebook1.entryfieldcustZip1.value)
***ship to address
CustomerAddRq.ShipAddress.Addr1.SetValue(_app.custform.notebook1.entryfieldcustname1.value)
CustomerAddRq.ShipAddress.Addr2.SetValue(_app.custform.notebook1.entryfieldcustAddress1.value)
(_app.custform.notebook1.entryfieldcustSuite1.value)
CustomerAddRq.ShipAddress.Addr3.SetValue(_app.custform.notebook1.entryfieldcustSuite1.value)
CustomerAddRq.ShipAddress.City.SetValue(_app.custform.notebook1.entryfieldcustCity1.value)
CustomerAddRq.ShipAddress.State.SetValue(_app.custform.notebook1.COMBOBOXCUSTSTATE1.value)
CustomerAddRq.ShipAddress.PostalCode.SetValue(_app.custform.notebook1.entryfieldcustZip1.value)
CustomerAddRq.CreditLimit.SetValue(_app.custform.notebook1.spinboxCreditLimit1.value)
(_app.custform.notebook1.COMBOBOX1.value)
CustomerAddRq.CustomerTypeRef.FullName.SetValue(_app.custform.notebook1.COMBOBOX1.value)
CustomerAddRq.TermsRef.FullName.SetValue("Net 15")
// Send the request set to QuickBooks
responseSet = sessionManager.DoRequests(requestMsgSet)
//Check response status and data
responseXML = responseSet.ToXMLString()
responseList = responseSet.ResponseList
response = responseList.GetAt(0)
if response.StatusCode = 0
vendorRet = response.Detail
ListID1 = VendorRet.ListID.GetValue()
//save listid to database field
_app.custlist.fields['listid'].value = ListID1
_app.custlist.save()
VendorName1 = VendorRet.CompanyName.GetValue()
box = msgbox(VendorName1 + " has been added to Quickbooks", "Quickbooks Vendor Modify", 64 )
else
box = msgbox(response.statusMessage, "Quickbooks ERROR # " + response, 16 )
endif
//Relinquish the communication channel with QuickBooks
sessionManager.EndSession()
sessionManager.CloseConnection()
sessionManager = NULL
release sessionManager
Post by MarkFrank,
That would also work for me, tho I heard Quicken dropped the import of QIF files in Quicken 2005. Know whether that is true?
Also, can you share any details on how I would get the data into Quickbooks. I figure whatever I write out to a QIF file would need to allow Quicken to create an AR Account for the customer if it is not there, then post the invoice, payment, or adjustment to that account. Am only interested in this accounts receivable data.
Any details much appreciated. Or maybe you have some written docs or reference on how this is done.
Thanks again,
Mark
Mark,
I think it can be done directly if yogurt use their SDK
I just create a QIF file and the client uses the QuickBooks Import
function to get it in
Frank Polan
Post by MarkI need to write accounts receivable items from a Plus table into Quickbooks, like billings, payments, and adjustments.
Anyone know how this can be done, or maybe have some code to share?
Many thanks,
Mark