Tuesday, 23 February 2021

AX 2012 AIF Error: Request failed. See the exception logs for details.

"Request failed. See exception logs for details."


This error occurred sometime in third party web services which are trying to consume AIF service from AX2012 inbound ports whenever the service code throws any exception. You can navigate to System administration > Periodic > Services and application integration framework > Exceptions to see the actual exception message from the logs.

However if you want to see the actual exception message in your web application instead of this message to see the exception logs, you need to configure the port to show exception with your faulty response. For that purpose just navigate to System administration > Setup > Services and application integration framework > Inbound ports and select the "Include exceptions in fault" checkbox for the your desired port.




Sunday, 21 January 2018

AX2012 : Merge table fields using AX compare tool

AX code compare utility is one of the most useful tool in morphX for transferring code packages from one environment to another but due to its limitation regarding merging of table objects, it sometimes become headache for the developers to merge table fields.

SysCompare class is the core class behind this utility. By adding this single line of code (i.e. highlighted in snapshot below) in selectionChanged method of SysCompare class we can also use this utility for merging of table fields.



Now after adding this line, we can see the arrow against the table fields too which is used for adding code into the server. And it will work like a charm.


It is still not useful for some other table objects like index, groups and relations. However, you can still use it in this regard to some extent by creating objects (i.e. index, groups etc) with the same name and save the table. Then when you try to merge those objects it will transfer the properties to that same name object.


Please note that changing in SysCompare class may cause difficulties in future upgrade of the software as it is a framework class.

Wednesday, 17 January 2018

SSRS : Column header not repeating on each page

In SSRS, we use this property of the tablix to repeat column heading in each page of the report.

But some times heading are not repeatable even after this check box is selected because of row grouping being used in the report. To handle this situation we make some changes in advance properties of the tablix like this:

Select the table for which the heading have to be repeated and check the Advance mode option as seen below:


Select the static from row group which is normally used for heading and set the two properties as highlighted in the image below:


Please note that there are two static tab before row grouping tab in our example due to the extra line below table heading. So we need to change the properties of both of the static tab in a scenario like this.

Now deploy the report and the header will repeat on each page even with the row grouping existed in the report.









SSRS : Report is printing an extra blank page

Some time we have a problem that report is printing an extra blank page in the last even when the data is completely being shown or sometime the blank page is showing between two pages of showing data.
This happens when the width of Body is greater than the width of Report. Normally we use to check for both width but we forgot to incorporate the left and right margin of the report with the width. To resolve this issue we need to make sure the the sizes as per following formula :

Report width >= Body width + Report left margin + Report right margin


To check for report properties just click the blank area outside the body and check for these properties:





And similarly to check for the body properties click on the body and check for its properties:



This will solve the blank page printing issue in report. 

Also note that sometimes blank page just simple occur because of using the Page break after property in the last tablix. So please make sure to set this property as false like the image below:




Dynamics AX SSRS Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Sometime this error occurs while running SSRS reports. It is due to long running queries which take too much time eventually reaches to report time out limit before the generation of report. The best solution to handle this issue is to run the report in pre-process so that SSRS fetch and process all the data even before reporting window is started.

To do this you need to do the following changes in reporting objects:


  • Change the extended class of the RDP class from SrsReportDataProviderBase to SrsReportDataProviderPreProcess.
  • Add the following line in the processReport method of RDP class just after contract class object initialization:
    • .setConnection(this.parmUserConnection());
  • Locate the table being used as data set in the report and change the properties highlighted in the image below:

  • Refresh report Dataset from visual studio only to get the new field createdTransactionId.
  • Generate the incremental CIL after deployment of the report.
  • Restart SSRS for the changes to take effect and now the report can be run with out the timeout error..

  •     


Thursday, 30 June 2016

SSRS error : Domain role with multiplicity 0..1 or 1 can hold at most 1 link..

We often get the following error when we try to duplicate any SSRS report in viusal studio or  we do any change in report parameters..



To resolve this error, we just need to reset report datasets as it is when a new dataset is created :
  • Set Data Source Type property to Query and remove anything which is already existed in Query property. (i.e Fig 1.0)


Fig 1.0 (Resetting dataset properties  )


  • Save and rebuild the report project, the above mentioned error would be resolved by now.
  • Now set the dataset properties as they were before and it will work like a charm.

Wednesday, 29 June 2016

Joining Datasources through Code using QueryBuildDataSource


Sometimes we need to add two or more datasources in our code. We use QueryBuildDatasource class for this purpose. Below is a sample job which is creating a query in code using Query class and joining two datasources by using QueryBuildDatasource class. And off course if we know how to add second datasource to first datasource, you could add more datasources using the same technique..  

static void JoiningTwoDatasourcesSample(Args _args)
{
    Query                       query;
    QueryBuildDatasource        queryBuildDatasource;
    query = new Query();

    //Adding table as the first datasource in query..
    queryBuildDatasource = query.addDataSource(tableNum(PurchTable));

    //adding table into the datasource of previously created datasource..
    queryBuildDatasource = queryBuildDatasource.addDataSource(tableNum(PurchLine));

    //Specifing which type of join you want to use in between both of the above datasources..
    queryBuildDatasource.joinMode(JoinMode::InnerJoin);

    //whether we want to use auto relations between table (i.e. True) or to create link by your own as mentioned below (i.e. False)
    queryBuildDatasource.relations(false);

    //Adding link to both table by specifying the fields of both tables which links them together..
    queryBuildDatasource.addLink(fieldNum(PurchTable, PurchId), fieldNum(PurchLine, PurchId));

    info(query.xml());

}