Skip to main content

I would like to code some actions that I can do manually:
- I have a sales order with two line items

- for one item a shipment was created.

- for the other item a production order was created

- the production order was completed and a move transaction was created

- Upon the “release” of the move transaction, I would like the below to occur via code:

- shipment screen; existing shipment for SO; “add order” dialog; select InventoryID that was just released from the “release”; click “add button”

 

I’ve been able to override the move/release button (below) but have no idea what code to write for the actual functionality.

 

        public IEnumerable Release(PXAdapter adapter, ReleaseDelegate baseMethod)
        {
            var baseReturn = baseMethod(adapter);

            var prodLines = Base.transactions.Select().RowCast<AMMTran>();

            foreach (var prodLine in prodLines)
            {
                // TODO: code to add to shipment
            }

            return baseReturn;
        }
 

 

move

 

prod order

 

 

sales order

 

shipment - add


 

shipment

 

@jkelly80 , I believe the business requirement/value needs to be clarified.

Obviously, such newly produced lines can be added to open (unconfirmed) shipments only. Also, if a sales order is set to allow partial shipments (otherwise, shipment without not yet produced item(s)  can’t be created), nothing prevents users from confirming such partial shipments without waiting for production. 

So, if users confirm shipments with just what they picked (without checking if all related production orders are completed), such technical solution is not going to be reliable. Its success will depend on whether production order is produced before warehouse pickers completed the shipment process (and clicked ‘Confirm Shipment’). Also, it is not clear what pickers should do in this case (because they probably pick according to the pick list created before the productin of the order). They might find extra line in a shipment after they thought they have completed the picking (or even packing) process. 

If on the contrary, pickers duly check that all production orders are completed before they complete (or even start) the picking process, then it is not clear what is the advantage to create a shipment before production orders are completed. In such case, a solution might be to set the Ship Complete rule in such sales orders to ensure that shipments are created only when all ordered items are available


Thanks for the insights. I am aware of the potential pitfalls, however they are not applicable to the intended workflow. I am just looking for some sample to code that would allow the functionality of the shipment screen / “add order” dialog (last step).


If it is necessary to implement this workflow, it can be done by means of business event. It does not bring about additional load on the release process and adds flexibility and transparency

 

Attached are components of this suggsted business events:

1. -SOAllocatedPlandWithExistingOpenShipments GI which shows sales order line allocations created by Move transactions and having open shipment for other order lines

2. MULT SHIPMENTS  Import scenario . It takes the output of GI as input (the sheet should be renamed to Sheet1) and runs the ADD Order action on the corresponding shipments for corresponding order lines.

 


Reply