This topic is locked

Recording Order Lots in Child Table

11/10/2020 9:16:08 AM
PHPRunner General questions
C
CWDATA author

I am building an application where in the Master table I will record incoming Order Details. Some orders will comprise several packages. I want to record the details of the packages in a Child Table. All the packages pertaining to the order will of course all have the OrderID index number against them. However, in a second column, I want to mark the lots as 1,2,3, etc. Then when the next order is entered and its packages are recorded the second column again marks lots 1,2,3 etc.

If anyone has a solution for this I would be very grateful.

Sergey Kornilov admin 11/10/2020

You will need to write a piece of PHP code snippet that would go through all items of a certain order and renumber them according to some rules. This piece of code will need to run after a new item was added or deleted so events AfterAdd and AfterDelete is where it needs to be added.

C
CWDATA author 11/12/2020



You will need to write a piece of PHP code snippet that would go through all items of a certain order and renumber them according to some rules. This piece of code will need to run after a new item was added or deleted so events AfterAdd and AfterDelete is where it needs to be added.


Thanks Sergey.
Any users out there have written a similar piece of code you could share?