Unique ID for entire client order

I want to achieve something like a transaction number for an entire order.
For example when i have created a sales order, a delivery note and a sales invoice i want to link the unique number to any of these doctypes so if i search for this number i get to see all the doctypes tha have been create to this number.

So what i need is a unique number which gets created when i start withe either a quotation or sales order and then get fetched by the other doctypes.

The fetching from the doctype is not the problem. I just cant find a working way to generate a unique id either in the quotation or the sale order.

Any thoughts and hints are highly appreciated

Thanks in advance
Nico

Hi @Nico:

Actually, delivery note and sales invoice (each item row) keeps reference to sales order. Why not use this sales order id as unique id?

You can create a custom field for delivery note and sales invoice and store there the sales order with a client or server script.

Anyway, it will not work properly if:

  1. There isn’t always a sales order …
  2. One delivery note contains items from different sales order …
  3. One sales invoice contains items from different delivery notes …

Maybe i didn’t understood your use case …
Hope this helps.

Hi @avc

thanks for the idea and sorry for the late reply.

The tricky part form me right now is, what do i do if i start with a quotation!?
I want to find a way to generate a sequential number which can either way be generated by the quotation or the sales order.
If i use the sales order number i will not get a sequential number if i generate a quotation!

Many thanks.