Skip to main content
Solved

Unable create shipment from same sales order by code


Hello,

I’m trying to create shipment by code. 

I’ve already create the shipment successfully, but while I trying to create shipment from same sales order but different inventory, it’ll show message below.

Here is my code I currently use.

            foreach (SOShipmentPlan res in tmpShipmentPlan.Cache.Cached)

            {

                //foreach(list in List<SOPreShipmentLine> lists) { }

                var plan = (SOShipmentPlan)res;

                plan.Selected = true;

                SOOrder order = PXSelect<SOOrder,

             Where<SOOrder.orderType, Equal<Required<PreAddSOFilter.orderType>>,

               And<SOOrder.orderNbr, Equal<Required<PreAddSOFilter.orderNbr>>>>>.Select(this, plan.OrderType, plan.OrderNbr);


                graph.soshipmentplan.Update(plan);


                graph.CreateShipment(order, shipment.SiteID, shipment.ShipDate, false, shipment.Operation, null);

                graph.soshipmentplan.Cache.Clear();

                tmpShipmentPlan.Cache.Clear();

            }

            graph.Actions.PressSave();

Is there any way to create new shipment from same sales order by code? Thanks!

Best answer by Naveen Boga

Hi @goldas54  From the Sales Order screen, if there is any OPEN shipment is available, the Sales Order status will be moved to “Shipping” status, and the system will NOT us to create another shipment until we confirm the first OPEN shipment.

 

Please confirm the first shipment and then create the new shipment.

View original
Did this topic help you find an answer to your question?

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3382 replies
  • Answer
  • March 21, 2022

Hi @goldas54  From the Sales Order screen, if there is any OPEN shipment is available, the Sales Order status will be moved to “Shipping” status, and the system will NOT us to create another shipment until we confirm the first OPEN shipment.

 

Please confirm the first shipment and then create the new shipment.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3382 replies
  • March 21, 2022

@goldas54  If you want to still, create another shipment (When there is an OPEN shipment already), then you need to override the Create Shipment Logic and work on it.

 


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