Wednesday, September 22, 2021

Modify contract class in controller in D365fo.

I got a requirement to send the details of caller table recid and tableId to contract class. I done by using

prePromptModifyContract() method. By using this method we can change report design based on user inputs.

class SalesInvoicePrintController extends SrsReportRunController

{

    SalesInvoicePrintContract   contract;

     protected void prePromptModifyContract()

    {

        RecId               recId;

        LedgerJournalTrans  journalTrans;

        InventTransferJour  inventTransferJour;

        CustInvoiceTable    custInvoiceTable;

         contract      = this.parmReportContract().parmRdpContract();

         if(this.parmargs().dataset() == tableNum(LedgerJournalTrans))

        {

            journalTrans  = this.parmargs().record();

            recId         = journalTrans.RecId;

            contract.parmRecId(recId);

            contract.parmTableId(tableNum(LedgerJournalTrans));

        }

            //controller.getDataContractObject()//// for sys operation     //controller.parmReportContract().parmRdpContract()

}


Keep Daxing !!

No comments:

Post a Comment