Thursday 10 March 2016

Periodic maintenance and performance analysis in AX

I recently came across a very useful article about the AX maintenance and performance.

Which is actually explains about how the DAX DB is really being used for real data and temp data.

In fact if you look into the DAX DB tables almost 60% of your DAX DB is being used by 4 tables unfortunately they are temp data i.e.INVENTSETTLEMENT, SYSDATABASELOG, SALESPARMLINE, INVENTSUMLOGTTS.

https://shekhardiptiman.wordpress.com/2010/01/14/dynamics-ax-%E2%80%93-periodic-maintenance-and-performance-analysis/

Periodic maintenance and performance analysis in AX

I recently came across a very useful article about the AX maintenance and performance.

Which is actually explains about how the DAX DB is really being used for real data and temp data.

In fact if you look into the DAX DB tables almost 60% of your DAX DB is being used by 4 tables unfortunately they are temp data i.e.INVENTSETTLEMENT, SYSDATABASELOG, SALESPARMLINE, INVENTSUMLOGTTS.

https://shekhardiptiman.wordpress.com/2010/01/14/dynamics-ax-%E2%80%93-periodic-maintenance-and-performance-analysis/

How to debugg the RDP Class in SSRS Reports on Dynamics AX2012

Hope every one is doing good.It has been long time since I shared the things into my blog.I am little bit busy with my current project and learning new things about SSRS,AIF and MVC.

Today I would like to share a very interesting and simple concept on SSRS,i.e

Debugging the SSRS RDP Class in Dynamics AX2012.

1) Class declaration of RDP class ,we need to replace the code like extends SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase 

2) Temp table properties should be
     (a) Table type :Regular 
     (b)  Created by : Yes
     (c) Created Transaction Id : Yes
Third step is not a mandatory.
3) In process report of the class add this line in Temporarytablename.setConnection(this.parmUserConnection());

How to debugg the RDP Class in SSRS Reports on Dynamics AX2012

Hope every one is doing good.It has been long time since I shared the things into my blog.I am little bit busy with my current project and learning new things about SSRS,AIF and MVC.

Today I would like to share a very interesting and simple concept on SSRS,i.e

Debugging the SSRS RDP Class in Dynamics AX2012.

1) Class declaration of RDP class ,we need to replace the code like extends SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase 

2) Temp table properties should be
     (a) Table type :Regular 
     (b)  Created by : Yes
     (c) Created Transaction Id : Yes
Third step is not a mandatory.
3) In process report of the class add this line in Temporarytablename.setConnection(this.parmUserConnection());

How to Display SSRS Report into Enterprise Portal in Dynamica Axapta 2012 R2

How to Display SSRS Report into Enterprise Portal in Dynamica Axapta 2012 R2 .Its very Easy.

Please see the below steps.

Step1:

After Creating the SSRS in AX,we need to add that into output menuItem with proper label.
Here label is very important because it will connect between Ep and AX.

Step 2:

\Go to your EP page selct the place where you need to display the Report.There we need to add the web Part click on that we can see the option like "Dynamics Report Server Report".

Step 3:

It will display all the outPut MenuItems,Here we can see the label names for the menuitems. Select your menuitems .thats it.

How to Calculate the time for the particular query time in Dynamics Axapta

How to Calculate the query timings ,how much time its working.

Check the below code you can identify :)

static void DateSplit(Args _args)
{
  date fixDate,fromdate,todate;
  int i,j;
  int         day,month,years;
  utcDateTime         jobStart, JobEnd;
  int64               jobRuntime;
  ;
    jobStart = DateTimeUtil::utcNow();
  fixDate = 22\1\2014;//systemDateGet();
  day = dayOfMth(fixDate);
  month = mthOfYr(fixDate);
  years = year(fixDate);

  info(strFmt("%1",day));

    if(day <=15)
    {
        fromdate = mkDate(1,month,years);
        todate   = mkDate(15,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
    else if(day <= 31)
    {
        fromdate = mkDate(16,month,years);
        todate   = mkDate(31,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
     jobEnd = DateTimeUtil::utcNow();
    jobRuntime = DateTimeUtil::getDifference(JobEnd, jobStart);
    info(strFmt("JOB DONE IN %1 SECONDS", int642str(jobRuntime)));
}

Create new Numberseq in Ax2012

How to create the new numberseq with Out disturb the existing class In ax2012.

1) Create the new Class extends with NumberSeqApplicationModule

class Sample extends NumberSeqApplicationModule
{

}

2)  Override the Loadmodule method()

protected void loadModule()

{

NumberSeqDatatype datatype = NumberSeqDatatype::construct();

/* Setup application numbers */

datatype.parmDatatypeId(extendedtypenum(EDT));

datatype.parmReferenceHelp(literalstr("Sample"));

datatype.parmReferenceLabel(literalstr("Sample"));

datatype.parmWizardIsContinuous(true);

datatype.parmWizardIsManual(NoYes::No);

datatype.parmWizardIsChangeDownAllowed(NoYes::No);

datatype.parmWizardIsChangeUpAllowed(NoYes::No);

datatype.parmWizardHighest(999999);

datatype.parmSortField(1);

datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);

this.create(datatype);

}
3) Select the numberseq for perticular form

public NumberSeqModule numberSeqModule()
{
    return NumberSeqModule::RetailParameters;
}

4) Goto Organisation and administration Module generate the numberseq in normal process.

Create new Numberseq in Ax2012

How to create the new numberseq with Out disturb the existing class In ax2012.

1) Create the new Class extends with NumberSeqApplicationModule

class Sample extends NumberSeqApplicationModule
{

}

2)  Override the Loadmodule method()

protected void loadModule()

{

NumberSeqDatatype datatype = NumberSeqDatatype::construct();

/* Setup application numbers */

datatype.parmDatatypeId(extendedtypenum(EDT));

datatype.parmReferenceHelp(literalstr("Sample"));

datatype.parmReferenceLabel(literalstr("Sample"));

datatype.parmWizardIsContinuous(true);

datatype.parmWizardIsManual(NoYes::No);

datatype.parmWizardIsChangeDownAllowed(NoYes::No);

datatype.parmWizardIsChangeUpAllowed(NoYes::No);

datatype.parmWizardHighest(999999);

datatype.parmSortField(1);

datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);

this.create(datatype);

}
3) Select the numberseq for perticular form

public NumberSeqModule numberSeqModule()
{
    return NumberSeqModule::RetailParameters;
}

4) Goto Organisation and administration Module generate the numberseq in normal process.

How to Calculate the time for the particular query time in Dynamics Axapta

How to Calculate the query timings ,how much time its working.

Check the below code you can identify :)

static void DateSplit(Args _args)
{
  date fixDate,fromdate,todate;
  int i,j;
  int         day,month,years;
  utcDateTime         jobStart, JobEnd;
  int64               jobRuntime;
  ;
    jobStart = DateTimeUtil::utcNow();
  fixDate = 22\1\2014;//systemDateGet();
  day = dayOfMth(fixDate);
  month = mthOfYr(fixDate);
  years = year(fixDate);

  info(strFmt("%1",day));

    if(day <=15)
    {
        fromdate = mkDate(1,month,years);
        todate   = mkDate(15,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
    else if(day <= 31)
    {
        fromdate = mkDate(16,month,years);
        todate   = mkDate(31,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
     jobEnd = DateTimeUtil::utcNow();
    jobRuntime = DateTimeUtil::getDifference(JobEnd, jobStart);
    info(strFmt("JOB DONE IN %1 SECONDS", int642str(jobRuntime)));
}

How to Display SSRS Report into Enterprise Portal in Dynamica Axapta 2012 R2

How to Display SSRS Report into Enterprise Portal in Dynamica Axapta 2012 R2 .Its very Easy.

Please see the below steps.

Step1:

After Creating the SSRS in AX,we need to add that into output menuItem with proper label.
Here label is very important because it will connect between Ep and AX.

Step 2:

\Go to your EP page selct the place where you need to display the Report.There we need to add the web Part click on that we can see the option like "Dynamics Report Server Report".

Step 3:

It will display all the outPut MenuItems,Here we can see the label names for the menuitems. Select your menuitems .thats it.

Error : Target file should be in UNC format – in batchprocess run in server ax2009

Error:  Target file should be in UNC format – in batch process run in server ax2009.

Normally we will get this error on batch process .I.e. when we run the report on screen and save the file in particular location /Email .The file will be saved in location with out any errors .

But when we do the same process on Batch .we will get this type of error.
Because in batch process, we will select the specific path to save the report, that particular path AOS Server couldn't able to identify the location.

That time we will get this type of error.

To solve this error, we need to create the folder in the location that location is accessible for all the users and as well as AOS Server also having the rights to access that path and run the bath again.

How to Convert SSRS Report into PDF By using X++.

Here is the code to convert SSRS report into PDF.
But Before converting the report to PDF we need to send the parameter values to Contract class after that we need to convert the report.

//For Converting Report to PDF
public void makeCommissionReport()
{
    Args                            args;
    SrsReportRunInterface           reportRun;
    SrsReportDataContract           contract;
    SrsReportRunController          controller;
    CommByAgencyContract            commContract;
    SRSPrintDestinationSettings     printSettings;
    SRSReportExecutionInfo          executionInfo;



    SrsReportRunImpl                srsReportRun;

    ReportName                      reportname =  "CommissionReportAgency.report";
    filenameType    = '.pdf';
    generatedReportFilePath = filePath + file + filenameType;
    args = new Args();
   /* args.record(record);
    retailStoretable = args.record(record);
    generatedDocument = false;
   */
    /*select custTable where custTable.AccountNum == retailStoretable.DefaultCustAccount;
    storenum = retailStoretable.StoreNumber;
    num      = custTable.InvoiceAccount;
    */
    controller = new SrsReportRunController();
    controller.parmReportName(reportname);
    commContract = controller.parmReportContract().parmRdpContract();
    commContract.parmfromdate(dat);
    commContract.parmTodate(endDate);
    commContract.ReciD(recid);
    controller.parmArgs(args);
    srsReportRun = controller.parmReportRun() as SrsReportRunImpl;
    controller.parmReportRun(srsReportRun);

    controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
    controller.parmReportContract().parmPrintSettings().overwriteFile(true);
    controller.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
    controller.parmReportContract().parmPrintSettings().fileName(generatedReportFilePath);
    controller.runReport();
    //generatedDocument = true;
}

How to Convert SSRS Report into PDF By using X++.

Here is the code to convert SSRS report into PDF.
But Before converting the report to PDF we need to send the parameter values to Contract class after that we need to convert the report.

//For Converting Report to PDF
public void makeCommissionReport()
{
    Args                            args;
    SrsReportRunInterface           reportRun;
    SrsReportDataContract           contract;
    SrsReportRunController          controller;
    CommByAgencyContract            commContract;
    SRSPrintDestinationSettings     printSettings;
    SRSReportExecutionInfo          executionInfo;



    SrsReportRunImpl                srsReportRun;

    ReportName                      reportname =  "CommissionReportAgency.report";
    filenameType    = '.pdf';
    generatedReportFilePath = filePath + file + filenameType;
    args = new Args();
   /* args.record(record);
    retailStoretable = args.record(record);
    generatedDocument = false;
   */
    /*select custTable where custTable.AccountNum == retailStoretable.DefaultCustAccount;
    storenum = retailStoretable.StoreNumber;
    num      = custTable.InvoiceAccount;
    */
    controller = new SrsReportRunController();
    controller.parmReportName(reportname);
    commContract = controller.parmReportContract().parmRdpContract();
    commContract.parmfromdate(dat);
    commContract.parmTodate(endDate);
    commContract.ReciD(recid);
    controller.parmArgs(args);
    srsReportRun = controller.parmReportRun() as SrsReportRunImpl;
    controller.parmReportRun(srsReportRun);

    controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
    controller.parmReportContract().parmPrintSettings().overwriteFile(true);
    controller.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
    controller.parmReportContract().parmPrintSettings().fileName(generatedReportFilePath);
    controller.runReport();
    //generatedDocument = true;
}

Error : Target file should be in UNC format – in batchprocess run in server ax2009

Error:  Target file should be in UNC format – in batch process run in server ax2009.

Normally we will get this error on batch process .I.e. when we run the report on screen and save the file in particular location /Email .The file will be saved in location with out any errors .

But when we do the same process on Batch .we will get this type of error.
Because in batch process, we will select the specific path to save the report, that particular path AOS Server couldn't able to identify the location.

That time we will get this type of error.

To solve this error, we need to create the folder in the location that location is accessible for all the users and as well as AOS Server also having the rights to access that path and run the bath again.