Using this code, accumatica create my new SOShipment from the new SOOrder. The new SOShipment is associated in New BranchId and that we need extactly.
Problem : the ShipmentNbr of new SOShipment get the perfix of the Old BranchId
SOShipmentEntry soShipmentGraph = PXGraph.CreateInstance<SOShipmentEntry>();
soShipmentGraph.Clear();
DocumentList<SOShipment> created = new DocumentList<SOShipment>(soShipmentGraph);
SOShipment sOShipment = new SOShipment();
created.Add(sOShipment);
soShipmentGraph.CreateShipment(newOrder,5, newOrder.OrderDate, true, SOOperation.Issue, created);
Best answer by Naveen B
Hi
As you are creating shipment from one branch to another branch. Please use the below code to set the current Branch and then have logic for creating the shipment.
int branchObj = 2;
PXContext.SetBranchID(branchObj);
Hope this helps !!
Best Regards,
Naveen B