After adding a non‑inventory purchase line to a PO through X++, I’m running into an issue. When I try to edit the PO, I am getting the following error:
Field 'Lot ID' must be filled in. Field 'Company' must be filled in.
I tried debugging but couldn’t identify the root cause. Am I missing something here? Any guidance would be helpful. Below is the code snippet to create purchline
axPurchLine.parmProcurementCategory(category.RecId);
axPurchLine.parmName("Service Line123");
axPurchLine.parmPurchQty(1);
axPurchLine.parmPurchPrice(1000);
axPurchLine.parmPurchUnit("ea");
purchLine.initValue();
purchLine.initFromPurchTable(purchTable);
purchLine.ProcurementCategory = category.RecId;
purchLine.Name = "Service Line";
purchLine.PurchQty = 1;
purchLine.PurchUnit = "ea";
purchLine.PurchPrice = 1000;
true,
true,
false,
false,
false,
false);

Report
All responses (
Answers (