Change field value in DP – General Journal

[ExtensionOf(classStr(LedgerJournalDP))]
final class MZNNM_LedgerJournalDP_Extension
{
[PostHandlerFor(classStr(LedgerJournalDP), methodStr(LedgerJournalDP, processReport))]
public static void LedgerJournalDP_Post_processReport(XppPrePostArgs args)
{
LedgerJournalDP dpInstance = args.getThis() as LedgerJournalDP;
ledgerJournalTmp ledgerJournalTmp = dpInstance.getLedgerJournalTmp();
LedgerJournalTrans ledgerJournalTrans;
LedgerJournalTrans_Project ledgerJournalTrans_Project;

ttsbegin;
while select forUpdate ledgerJournalTmp
{
ledgerJournalTrans.clear();
select * from ledgerJournalTrans
where ledgerJournalTrans.Voucher == ledgerJournalTmp.Voucher;
if(ledgerJournalTrans)
{
ledgerJournalTrans_Project.clear();
select * from ledgerJournalTrans_Project
where ledgerJournalTrans_Project.RefRecId == ledgerJournalTrans.RecId;
ledgerJournalTmp.AccountNum +=’-‘+ ledgerJournalTrans_Project.CategoryId;
ledgerJournalTmp.update();
}

}
ttscommit;
}

}

Leave a Reply

Your email address will not be published. Required fields are marked *