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.
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/48b60dfe-1cf0-4da8-9c22-d9ec03ed5210.png)
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!