How to setup the naming series?

Then maybe you can give draft documents a temporary name like temp-inv-0001 then create a server script on submit to Rename Doc

In that case,

  1. There is no need for our additional fields
  2. Set the default naming series to “Temp-INV-####”
  3. Create a server script on submit that will;
    3.a. Get last doc from invoiceIndex
    3.b. Get the last_doc.index
    3.c. Check customer territory if it’s export or not
    3.d. Rename the current doc to “INV-last_doc.index” or “INV-EX-last_doc.index”
    3.e. Delete all docs in invoiceIndex
    3.f. Create a new doc in invoiceIndex with the index of last_doc.index + 1
2 Likes