Skip to main content
Question

Ovveride Create Shipment logic


Forum|alt.badge.img

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

darylbowman
Captain II
Forum|alt.badge.img+13

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


Forum|alt.badge.img

Yes. It is my custom grid


darylbowman
Captain II
Forum|alt.badge.img+13

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


Forum|alt.badge.img

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


darylbowman
Captain II
Forum|alt.badge.img+13

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.


Forum|alt.badge.img

 @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


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2749 replies
  • March 29, 2024

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings