Question

Ovveride Create Shipment logic

  • 19 February 2024
  • 7 replies
  • 85 views

Hello. I have one question. How to better make next logic

When pressing Create Shipment on Sales Order screen i want to create for each package 
row in right grid with quantiry that this package have
 

 


7 replies

Userlevel 7
Badge

Hi @VadymBoichenko96 were you able to find a solution? Thank you!

 @Kandy Beatty @Laura02 

I am trying to take quantity that package have and item that package have on shipment screen packages tab
But if i do in this way 
 

        public virtual void CreateShipment(CreateShipmentArgs args, CreateShipmentDelegate baseMethod)
        {
            baseMethod(args);

            var packages = Base.Packages.Select().FirstTableItems;

            foreach (var package in packages)
            {
                var test = package.InventoryID;
                var test1 = package.Qty;

}

inventoryID is null and Qty is 0.0. As i understood CreteShipment have this logic when it's calculating weight for package based on qty and item. How can i get this values? I goes throught CreateShipment method and have not found anything that could help me with that problem

Badge +11

My understanding is that the Packages tab is basically a list of boxes. The best suggestion I can give you is to somehow pull the items from the Details tab instead and use it to populate your grid.

@Kandy Beatty or @Laura02 could give you more functional shipping advice.

Yes. For now i have this
 

public delegate void CreateShipmentDelegate(CreateShipmentArgs args);
        [PXOverride]
        public virtual void CreateShipment(CreateShipmentArgs args, CreateShipmentDelegate baseMethod)
        {
            baseMethod(args);

            var packages = Base.Packages.Select().FirstTableItems;

            foreach (var package in packages)
            {
                var salesOrder = (SOOrder)PXSelectJoin<SOOrder,
                            InnerJoin<SOLine, On<SOOrder.orderType, Equal<SOLine.orderType>,
                                                And<SOOrder.orderNbr, Equal<SOLine.orderNbr>>>>,
                            Where<SOLine.lineNbr, Equal<Required<SOLine.lineNbr>>>>
                            .Select(Base, package.LineNbr);

                if (salesOrder != null)
                {

                }

                /*SelectedPackageContents selectedPackageContents = new SelectedPackageContents
                {
                    ShipmentLineNbr = package.LineNbr,
                    ShipmentNbr = package.ShipmentNbr,
                    PackedQty = package.Qty,
                };

                SelectedPackageContentsView.Insert(selectedPackageContents);*/
            }
        }


When shipment creating i want to make something like this
 


But in upper grid i can not take Qty of items in package and also there is no InventoryID in package. The main problem not to take Qty for package

Badge +11

And what are you trying to accomplish? Have you tried anything so far?

Yes. It is my custom grid

Badge +11

Is the ‘Estimated Content’ area a customization? I’ve not seen that before.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved