Customer ageing report Extension

 public class TECCustAgingReportController_Ext extends CustAgingReportController

{

     public static TECCustAgingReportController_Ext construct()

     {

          return new TECCustAgingReportController_Ext();

     }


     public static void main(Args _args)

     {

          TECCustAgingReportController_Ext controller = TECCustAgingReportController_Ext::construct();

          controller.parmReportName(ssrsReportStr(TECCustAgingReport, DesignWithNoDetailAndNoTransactionCur));

          controller.parmArgs(_args);

          controller.startOperation();

     }


     protected void preRunModifyContract()

     {

          str  reportDesign;

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


          if (contract.parmDetailed())

          {

               if (contract.parmIncludeAmountCur())

               {

                    reportDesign = ssrsReportStr(TECCustAgingReport, DesignWithDetailAndWithTransactionCur);

               }

               else

               {

                    reportDesign = ssrsReportStr(TECCustAgingReport, DesignWithDetailAndNoTransactionCur);

               }

          }

          else

          {

               if (contract.parmIncludeAmountCur())

               {

                    reportDesign = ssrsReportStr(TECCustAgingReport, DesignWithNoDetailAndWithTransactionCur);

               }

               else

               {

                    reportDesign = ssrsReportStr(TECCustAgingReport, DesignWithNoDetailAndNoTransactionCur);

               }

          }


          this.parmReportContract().parmReportName(reportDesign);          

     }


}


=================================================================



public class TECCustAgingReportHandler

{

     /// <summary>

     /// Event handler for inserting the record

     /// </summary>

     /// <param name="sender"></param>

     /// <param name="e"></param>

     [DataEventHandler(tableStr(CustAgingReportTmp), DataEventType::Inserting)]

     public static void CustAgingReportTmp_onInserting(Common sender, DataEventArgs e)

     {

          CustAgingReportTmp custAgingReportTmp = sender;


          custAgingReportTmp.TECSalesResponsible = HcmWorker::find(CustTable::find(custAgingReportTmp.AccountNum).TECSalesResponsible).name();

     }


     /// <summary>

     /// Post event handler for updating the record

     /// </summary>

     /// <param name="args"></param>

     [PostHandlerFor(classStr(CustAgingReportDP), methodStr(CustAgingReportDP, processReport))]

     public static void CustAgingReportDP_Post_processReport(XppPrePostArgs args)

     {

          CustAgingReportDP dpInstance = args.getThis() as CustAgingReportDP;

          CustAgingReportTmp custAgingReportTmp = dpInstance.getCustAgingReportTmp();


          ttsbegin;

          while select forUpdate custAgingReportTmp

          {

               custAgingReportTmp.TECSalesResponsible = HcmWorker::find(CustTable::find(custAgingReportTmp.AccountNum).TECSalesResponsible).name();

               custAgingReportTmp.update();

          }

          ttscommit;

     }


}


==============================================================


Extension of the menu item CustAgingBalance.STPLDevExtension and change the controller class to the customer class


=====================================================================

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++