Hello,
I created and confirmed SOShipment via this code. It works well.
The problem persists when I want to create an invoice from this shipment.
I want to create the invoice from the application.
Error Message: “Unable to generate next number for ARINVOICE sequence”.
SOShipmentEntry soShipmentGraph = PXGraph.CreateInstance<SOShipmentEntry>();
soShipmentGraph.Clear();
DocumentList<SOShipment> created = new DocumentList<SOShipment>(soShipmentGraph);
soShipmentGraph.CreateShipment(order, shipment.SiteID, order.OrderDate, false, SOOperation.Issue, created);
soShipmentGraph.ShipPackages(shipment);
PXAutomation.CompleteSimple(soShipmentGraph.Document.View);
PXAdapter adapter2 = new PXAdapter(new DummyView(soShipmentGraph, soShipmentGraph.Document.View.BqlSelect,
new List<object> { soShipmentGraph.Document.Current }));
adapter2.Menu = SOShipmentEntryActionsAttribute.Messages.ConfirmShipment;
adapter2.Arguments = new Dictionary<string, object>
{
{"actionID", SOShipmentEntryActionsAttribute.ConfirmShipment}
};
adapter2.Searches = new object[] { soShipmentGraph.Document.Current.ShipmentNbr };
adapter2.SortColumns = new[] { "ShipmentNbr" };
soShipmentGraph.action.PressButton(adapter2);
Best regards.