Hello, getting an error: Invalid or missing header on the code below- can anyone provide a working example of creating a purchase order in BOI?
using (var sySession = new MasSession(homePath))
{
sySession.InitSession(sessionLogon);
CI.ColumnNames.Add("PO_PURCHASEORDER_BUS", new Dictionary<string, string> { { CI.NextNumberMethod, "nGetNextPurchaseOrderNo" }, { CI.HeaderKeyColumns, "PurchaseOrderNo$" } });
using (var poEntry = sySession.CreateObject<ILineEntry>("PO_PurchaseOrder_bus", "PO_PurchaseOrder_ui", "P/O"))
{
var nextOrderNo = poEntry.GetNextDocumentNumber();
poEntry.SetKeyValue("PurchaseOrderNo", nextOrderNo);
poEntry.SetValue("PurchaseOrderDate", "20231101");
poEntry.SetValue("OrderType", "S");
poEntry.SetValue("APDivisionNo", "00");
poEntry.SetValue("VendorNo", "0008000");
poEntry.AddLine();
Trace.WriteLine(poEntry.Lines.GetKey());
poEntry.Lines.SetValue("ItemCode", "1001-HON-H252");
poEntry.Lines.SetValue("QuantityOrdered", 2);
poEntry.Lines.Write();
poEntry.Write();
}
}
