Showing posts with label Customer Transaction journal line. Show all posts
Showing posts with label Customer Transaction journal line. Show all posts

Friday, February 17, 2023

How to get data for customized fields in customer transactions for a journal line after post.

[ExtensionOf(classStr(CustVendVoucher))]

final class DaxCustVendVoucher_Extension

public void post(LedgerVoucher ledgerPostingJournal,

                    CustVendTrans custVendTrans,

                    NoYes approval, 

                    UnknownNoYes euroTriangulation,

                    boolean withHoldTaxType,

                    boolean useSubLedger)

{        

LedgerJournalTrans  ledgerJournalTransLocal;        

VendTrans   vendTransUpdate;        

CustTrans   custTrans;        

Common  commonLocal = common;          

next post(_ledgerPostingJournal, custVendTrans, approval, euroTriangulation, withHoldTaxType, useSubLedger);        

if (commonLocal.TableId == tableNum(LedgerJournalTrans))        

{            

ledgerJournalTransLocal = commonLocal;            

if (custVendTrans.tableid == tableNum(CustTrans))            

{                

ttsbegin;                

select firstonly1 custTrans                

where custTrans.RecId == _custVendTrans.RecId;                

custTrans.selectForUpdate(true);                

custTrans.PaymentDate = ledgerJournalTransLocal.PaymentDate;                

custTrans.doUpdate();                

ttscommit;            

}        

}    

}

similarly, get the data for customized fields in vendor transctions(vend trans) just by placing vend trans table in custtrans  place.