Method Community

 

Invoice Table

Last post 12-13-2012 9:57 AM by Method_David. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-08-2012 4:28 PM

    Invoice Table

    Am I able to add an invoice by inserting a new record and then it will sync with QB?

    OR is it more complicated, I came across this in the API docs

    However, in some circumstances it does not, especially on transactions (for example Invoices) that require line items (such as InvoiceLine). In those scenarios, you would first insert the transaction, then insert the line items, and then finally call  SendToDesktopV2 to let Method know that you are finished adding line items and it is ready to go to QuickBooks.

    So I can't just add the lineitems when I am inserting a new invoice record?

    If not, then how do you "insert the line items", then call SendToDesktopV2

    TIA

  • 12-08-2012 6:00 PM In reply to

    Re: Invoice Table

    Hi Tia,

    My colleague (Jim Baker) and I did a short 13 minute webinar on that subject at:  http://www.simplifiedbusinessportals.com/siteContent/learningCenter/msps.html

    Basically, in order to create an invoice from another screen we need to insert a record into the Invoice table and the InvoiceLine table.  In order to insert into the InvoiceLine table, you'll need to know what the record ID is for the new record you have just created in the Invoice table.

    I hope the video helps answer your question.

    April Hooper
    "Connecting Businesses through Method CRM"
    Simplified Business Portals, LLC

    Advanced Method Certified Account Manager
    310 313 2879

  • 12-13-2012 9:57 AM In reply to

    Re: Invoice Table

    Answer


    Hi TIA,

    You first need to add an invoice, then the invoice line items, them call the sync. Below is a simple C# example.

    Step1 let's create an invoice for my customer called ACustomer

    string[ arrInsertFieldsArray = new string[ { "ArAccount", "Customer", "TxnDate" };

    string[ arrInsertValueArray = new string[ { "Accounts Receivable", "ACustomer", "13/Dec/2012" };

    lblMethodAPIInsertV2.Text = _MethodAPI.MethodAPIInsertV2(CompanyAccount, Login, Password, "", "Invoice", arrInsertFieldsArray, arrInsertValueArray);

    That call will return the following xml

    <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" RecordID="82" ></MethodAPI>

     

     

    Step 2. We now have a new invoice with a recordid of 82. So we can then insert invoiceline items (repeat as needed for the various items you have). In my case I'm gonna say they bought 3 of SomeItem for a rate of 111.00

    string[ arrInsertFieldsArray = new string[ { "InvoiceRecordID", "Item", "Quantity", "Rate" };

    string[ arrInsertValueArray = new string[ { "82", "SomeItem", "3", "111.00" };

    lblMethodAPIInsertV2.Text = _MethodAPI.MethodAPIInsertV2(CompanyAccount, Login, Password, "", "InvoiceLine", arrInsertFieldsArray, arrInsertValueArray);

    That call will return the following xml

    <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" RecordID="223" ></MethodAPI>

     

    Step 3. call the sync function

    Now we have an invoice with line items all that is left is to invoke the sync function for the invoice.

    lblMethodAPIActionSendToDesktopV2.Text = _MethodAPI.MethodAPIActionSendToDesktopV2(CompanyAccount, Login, Password, "", "Invoice", "82");

     

    Dave

     

     

Page 1 of 1 (3 items)