The problem is related to the setting of the inventDimId on the purchParmLine. Despite updating the purchParmLine it wants to use the purchLine inventDimId. The result is an error message saying serial number must be entered. Any ideas? In debug the purchParmTable and purchParmLine look good.
|
purchTable = PurchTable::find(_purchId); purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip); // move to first statement parmid=purchFormLetter.parmId(NumberSeq::newGetNum(CompanyInfo::numRefParmId()).num()); parmId= purchFormLetter.parmId(); purchFormLetter.createParmUpdate(); purchParmtable= purchParmtable::find(_purchid,parmid); purchFormLetter.createParmTable(purchParmTable,purchTable); purchParmTable.Num = _packSlipId; purchParmTable.insert();
while select firstonly purchLine where purchLine.PurchId == purchTable.PurchId && purchLine.ItemId == _itemId && purchLine.LineNum == _linenum { foundRecord = True; purchParmLine.ParmId = purchParmTable.ParmId; purchParmLine.TableRefId = purchParmTable.TableRefId; purchParmLine.InitFromPurchLine(purchLine);
purchParmLine.ReceiveNow = 1; purchParmLine.setQty(DocumentStatus::PackingSlip, false, true); purchParmLine.setLineAmount(); newDim.wMSLocationId = '5NEW'; newDim.InventLocationId = 'PSF'; newDim.InventSerialId = _inventSerialId; newDim.InventSiteId = '0101'; purchParmLine.InventDimId = InventDim::findOrCreate(newDim).inventDimId; purchParmLine.insert();
} if (foundRecord) { purchFormLetter.proforma (false); // proforma ? purchFormLetter.printFormLetter(_printPack); // print ? purchFormLetter.specQty (PurchUpdate::PackingSlip); // what to update? purchFormLetter.transDate (today()); // update date purchFormLetter.run(); }
|
*This post is locked for comments
I have the same question (0)