I tried to create Line Item No for each instance of Purchase Order Line Item by checking for current “max” number in preCommit() method of “purchase-order-line-edit.xml”, and assign max+1 to the value of Line Item No.
After the first purchase-order-line is saved and return to the purchase-order-edit screen, it successfully assigned 1 to the line item No. But when the second line item is created. It still assigns the value of “1” to the second line.
Currently I have to click “Save” after each creation of Purchase Order Line Item before Create the next new item so the numbering method works properly for the next new line item.
Where should I trigger the super.commit() method in purchase-order-edit controller such that it automatically commit the newly created Purchase Order Line item to Purchase Order?
If you want to generate unique values for the numbers of order-line, then you should use Sequence Generation. Please, check the documentation for more information.
Is it possible to create orderlines and save the order without closing the order window-edit.
There could have been a button for saving the order without closing the window.
Ex: Save button, Apply button and Close/Cancel button in the Window action group.
You can achieve this by replacing the editWindowActions frame to the extendedEditWindowActions frame
<frame id="windowActions" screen="extendedEditWindowActions"/>
Please, check the documentation for more information.
Thanks for the tip. I have implemented by using Unique Number for each PO.