Hi All,
I don't want to continue with missing items. If any item of production is missing, should be give error, should't to transfer missing items to a new journal. I tried paremeters which redlined at below, still generates new journal for missing items:
...
boolean ret = true; prodJournalProd prodJournalProd; ProdJournalCheckPostProd ProdJournalCheckPostProd; ProdJournalTableData JournalTableData; ProdJournalTable journalTable;
journalTable.clear(); journalTable.initValue(); journalTable.ProdId = _prodtable.ProdId;
JournalTableData = JournalTableData::newTable(journalTable); journalTable.JournalId = JournalTableData.nextJournalId(); journalTable.JournalType = ProdJournalType::ReportFinished; journalTable.JournalNameId = JournalTableData.journalStatic().standardJournalNameId(journalTable.JournalType); JournalTableData.initFromJournalName(ProdJournalName::find(journalTable.JournalNameId));
journalTable.DetailSummary = DetailSummary::Summary; journalTable.VoucherDraw = JournalVoucherDraw::Post; journalTable.VoucherSeqRecId = NumbersequenceTable::find(ProdParameters::numRefProdCalcVoucherId().NumberSequenceId).RecId; journalTable.DrawNegative = false; //memre 16.8.18 #448 journalTable.AcceptError = NoYes::No; //memre journalTable.insert();
prodJournalProd.clear();
prodJournalProd.JournalId = journalTable.JournalId; prodJournalProd.initFromProdTable(prodTable::find(journalTable.ProdId));
// prodJournalProd.TransDate = _transDate; prodJournalProd.TransDate = this.checkTransDate(_prodtable.ProdId,_transDate);
prodJournalProd.ProdId = journalTable.prodID; prodJournalProd.ItemId = _prodtable.ItemId; prodJournalProd.QtyGood = _qty;
prodJournalProd.InventDimId = _prodtable.InventDimId; prodJournalProd.ProdPickList = true; prodJournalProd.PmfAcceptError = NoYes::No; prodJournalProd.insert();
ProdJournalCheckPostProd = ProdJournalCheckPostProd::newPostJournal(journalTable.JournalId,true); //memre 16.8.18 #448 ProdJournalCheckPostProd.parmTransferErrors(true);
ProdJournalCheckPostProd.parmThrowCheckFailed(true); //memre ProdJournalCheckPostProd.run();
By missing, do you mean items with no/sufficient on hand?
metin emre said:ProdJournalCheckPostProd.parmTransferErrors(true);
If you don't want to transfer error lines to new journal, then why are you setting this to true?
Yes, I meant no/sufficient on hand. I just tried this to false, it doesn't transfer a new journal now, but production still posts.
So does that item consumed even there is no enough on hand?
No, but product produced. I wanted to production process to cancelled if journal for consume item couldn't be posted.
Is there a inventory transaction? If so, what is the state of item transaction that is used in the journal?
OK. Do you mean no picking list journal is posted?
Looked at the code and that is how it's been designed. The RAF journal posts even the picking list posting fails.
\Classes\ProdJournalCheckPost\postProdJournalTableBOM - prodJournalCheckPostBOM.parmThrowCheckFailed(false); is set to false in the code.
Look at \Classes\ProdJournalCheckPostProd\run, the RAF posting and picking list posting are not in a single transaction scope. So even the picking list posting fails, the RAF posting will not rollback.
Nooooo.
Thank you very much. Seem we need another solution or extend class and modify...