I hope no one minds me posting newbie questions here.
I would like to add an invoice number to my web application when a user creates a new form. What would be the easiest way to do this?
I can create a field, “invoice#”. How do I calculate the next invoice number to use?
Where would I store the last invoice number used so that it could be retrieved and incremented on the next form?
Subject: Create and increment an invoice number on form creation
I’ve created a view where 1st column is all invoices number created in my DB. I’m doing a :
@If(@IsNewDoc;
@If(@Elements(@DbColumn(“” : “”; “notes/mcj/ca” : “invoices.nsf”; “($incoices\summary)”;1))>0;
@Text(@Max(@DbColumn(“” : “”; “notes/mcj/ca” : “invoices.nsf”; “($invoices\summary)”;1))+1);
@Prompt([OkCancelEdit]; "Please enter the first invoice number "; “Please enter the initial invoice number.Ex:100000.”; “100000”)
);
@Nothing
)
First column of($invoices\summary) view is the invoice number of of each invoice document already created. I do a @Max to get the higher number +1. If there is no invoice document, I ask the user to enter the first invoice number.