Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: Controller Code for 2 Reports in 1 Button

$
0
0

There can be two ways

  1. Create Two controller class (which in my personal option, is a non-optimized way usually)

    Example of #1

    ControllerClass1Name                   objectControllerClass1;

    ControllerClass1Name                   objectControllerClass2;

     

    If(Sales.Qty == 0 )

    {

                    //Proceed with objectControllerClass1

    }

    Else

    {

                    //Proceed with objectControllerClass2

    }

     

  2. Create single controller class and handle logic inside

    Example of #2

    AOT >> Classes >> smmReportsController

    Have a look at main method>> line number 2

     

    controller.parmReportName(smmReportsController::getReportName(_args));

     

    Go inside smmReportsController::getReportName

     

    Here you can see conditions and how multiple designs are handled

     

    You can put your condtions such as follwing

     

    salesTableRecId = _args.record().RecId

    //calculate you quantity based on salesTableRecId

    And then proceed with condition

    If(….)

    {

     

    }

    …….

     


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>