Quality order creation In D65fo using X++
static void Quality(Args _args)
{
InventQualityOrderTable inventQualityOrderTable;
NumberSeq NumberSeq;
InventQualityOrderId QualityOrderId;
InventDim inventDim;
NumberSeq=NumberSeq::newGetNum(InventParameters::numRefQualityOrderId());
NumberSeq.used();
QualityOrderId = NumberSeq.num();
ttsBegin;
inventDim.initValue();
inventDim.InventSiteId = "1";
inventDim.InventLocationId = "13";
inventDim = InventDim::findOrCreate(InventDim);
inventDim.insert();
inventQualityOrderTable.initValue();
inventQualityOrderTable.ReferenceType = InventTestReferenceType::Inventory;
inventQualityOrderTable.QualityOrderId = QualityOrderId;
inventQualityOrderTable.ItemId = "D0001";
inventQualityOrderTable.TestGroupId = "Concentrat";
inventQualityOrderTable.Qty = 0.002;
inventQualityOrderTable.InventDimId = "000072";
inventQualityOrderTable.insert();
ttsCommit;
if(InventQualityOrderTable.Qty)
{
info(strFmt("%1",inventQualityOrderTable.QualityOrderId));
}
}
Keep Daxing!!