Jump to content

How to get newly created Invoice number


 Share

Recommended Posts

 Hi ,

I am using oInvoicePost.Update() to create new invoice, I would like to get the newly created invoice number like shown below. is there any way to get that?

// Update the Invoice
                        if (oInvoicePost.Update())
                        {
                           // var Xyz = oInvoicePost.Items["INVOICE_NUMBER"];
                            returnValue ="Successfully created Sage Invoice";
                        } 

 

Link to comment
Share on other sites

Hi, 

Thanks for the question. 

It is possible to read the INVOICE_NUMBER field at the point of update using the following code

if (oInvoicePost.Update())
                {
                    // Line below shows that the Invoice number can be read post update
                    int i = SDOHelper.Read(oInvoicePost.Header, "INVOICE_NUMBER");

                    MessageBox.Show("Invoice number " + i + " created successfully");
                }

Regards

Alisdair

 

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...