Sunday, January 7, 2024

Generate Payment Advice Report for selected record in D365F&O X++

 Accounts Payable>Vendor Payment Journal>Lines>Print>Payment Advice

The standard report is generating for all the line records automatically, Our requirement is to generate the report for only selected record.

[ExtensionOf(classStr(BankPaymAdvicePaymentQueryGenerator))]

internal final class DaxBankPaymAdvicePaymentQueryGenerator_Extension

{

   public QueryRun getPaymentLineQueryRun(BankPaymAdviceContract _bankPaymAdviceContract)

   {

       Query query ;

       QueryRun    queryRun;

       queryRun = next getPaymentLineQueryRun(_bankPaymAdviceContract);

       query = queryRun.query();

       query.dataSourceTable(tableNum(LedgerJournalTrans)).addRange(fieldNum(LedgerJournalTrans, RecId)).value(queryValue(_bankPaymAdviceContract.parmLedgerJournalTransRecId()));

       return queryRun;

   }

}

.............................

[ExtensionOf(classStr(BankPaymAdviceUIBuilder))]

internal final class DaxBankPaymAdviceUIBuilder_Extension

{

   private DialogField dialogRecid;

   public void postRun()

   {

       next postRun();

 

       LedgerJournalTrans ledgerJournalTrans;

       BankPaymAdviceContract contract = this.dataContractObject();

       if (this.controller().parmArgs() && this.controller().parmArgs().record())

       {

           ledgerJournalTrans = this.controller().parmArgs().record() as LedgerJournalTrans;

       }

       contract.parmLedgerJournalTransRecId(ledgerJournalTrans.RecId);

   }

}

.................................

Output :






No comments:

Post a Comment