My requirement is in quality order, based on item number and batch the version numbers to be inserted and also increment the version number, if new quality order is created for same item number and Batch number. How can we achieve this.
For ex: If there is item : item001 with Batch : Bat001, With same item and Batch, if there are 3 existing Quality order: Q001, Q002 and Q003,
1)How can we insert version 0, version 1, version 2 respectively to the quality order and
2) in case a new quality order Q004 is created, then version number to be updated as Version 3.
Quality order id | Item id | Batch | Version no |
Q001 | item001 | Bat001 | 0 |
Q002 | item001 | Bat001 | 1 |
Q003 | item001 | Bat001 | 2 |
Q004 | item001 | Bat001 | 3 |