Add a new datasource to InventOnHandItem form

To add a new datasource to the form InventOnHandItem, you have to follow these steps. In my case I've added the (InventTable).GTIN to the form. Add the table (in the example I've used the InventTable) to the form's datasource Modify the method modifyQuery in the class InventDimCtrl_Frm_OnHand: add the new datasource to the method declaration and … Continue reading Add a new datasource to InventOnHandItem form

Post Product receipt from code X++

PurchFormLetter  purchFormLetter ProductReceiptId productReceiptId; PurchLine        purchLine; PurchTable       purchTable = PurchTable::find('123456'); PurchQty         purchQty = 20; while select purchLine where purchLine.PurchId == purchTable.PurchId && purchLine.IsDeleted == NoYes::No { purchLine.PurchReceiveNow = purchQty; purchLine.setInventReceiveNow(); purchLine.update(); } purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip); purchFormLetter.update(purchTable, productReceiptId, purchFormLetter.transDate(), PurchUpdate::ReceiveNow); purchTable.reread();