Posts Tagged ‘ax2012’

Error: SSRS/EP error when the return type in display method is incorrect – Dynamics AX 2012

October 11, 2013 1 comment

When you work with data sources through a query in EP/SSRS you might land up in this error “Data or calculated fields with type “Record” are not supported”.

Record_type_error (2)

How do i resolve ?

One of the tables that is being used in the data source has a display method with a return type as “record”.  Scan through all the display methods and find the one that has the display keyword but still returns a type record in the signature. In our case we had a method similar to this

    Public display inventTable getInventTable()
         return InventTable::find(this.itemid);

Why does this happen ?

It is illegal to use a display keyword for a method that returns any complex object like “Container”, “Record”, “Class”. The reason we don’t find it inside AX is because compiler doesn’t validate it and it can be deducted only at run time. So say you have you a display method as in the example above but you never use it then AX never complains about it.

When these tables are accessed through Query in SSRS, SSRS tries to run through the list of display methods to show up in the field selection. Since SSRS cannot comprehend the return type it throws this error.

For more tips and learning about SSRS – AX 2012 order the book Dynamics AX 2012 Reporting Cookbook authored by me.


SSRS Tip: Prevent report execution through controller – Dynamics Ax 2012

September 25, 2013 Leave a comment

What a user might hate to see is a blank report. No matter where the mistake lies the earlier we react the happier the user is. Here today i’m sharing a tip on how you could stop/warn/show a info after the report execution is initiated  after the user clicks the “Ok” button in the dialog.

In the example discussed here, the idea is to check preemptively if a query will return a record or not. If no then the report aborts execution.

To implement this, open the controller of your report or create one.

On the controller class, override the method “preRunValidate”

Place the code as shown here. This method is invoked after the user clicks the “Ok” button and before the report is executed. Do not block the super call in this method as it does few other important validations. This method can return an error/warning/info. If it is a warning or error the report aborts further execution.

protected container preRunValidate()
    container   validateResult = super();
    Query       firstQuery;
    int         recordcount;

    firstQuery          = this.getFirstQuery();
    custStatementCount  = QueryRun::getQueryRowCount(firstQuery, 6);
    if (custStatementCount > 5)
        validateResult = [SrsReportPreRunState::Error, "No valid records found for the specified range"];

    return validateResult;

Standard recommends the method to be used for validating if the report returns a large amount of data.For reference see \Classes\CustAgingReportController\preRunValidate\
For more tips and learning about SSRS – AX 2012 order the book Dynamics AX 2012 Reporting Cookbook authored by me.


SSRS Tip: Printing Row headers in every page – Dynamics Ax 2012

September 23, 2013 2 comments

This post today will discuss how to print row headers in every page for tablix.

When your table has a header

When using table type tablix with headers as seen in the below image, right click on the Tablix properties and select “Repeat header rows on each page” (If you use a matrix control please check the same for “Repeat header columns on each page”)


When you use a static tablix member in Row or Column.

If you don’t realize what a static tablix member, select a table and insert a row using the option “Outside Group – Above” or simply Insert Row -> Above if you don’t have any groupings. Now open the Group mode window (if not open, click the grouping icon from your report tool bar grouping_windo) and then click Advanced mode. The system will show up static members in a table. These are members that are calculated once and are rendered in one or multiple pages. These controls can also be used like headers.

Coming back, Once you have identified the static tablix member you want to repeat, On the property of the tablix member set “RepeatOnNewPage” to True. (If this doesn’t work outright, try setting the property “KeepWithGroup”  to “After”)


For more tips and learning about SSRS – AX 2012 order the book Dynamics AX 2012 Reporting Cookbook authored by me.


Dev Tip: Activating document handling for inquiry(read only) forms – Dynamics Ax 2012

September 20, 2013 Leave a comment

This post will explain how document handling can be activated only for specific tables or for all tables.

Activate document handling for selective tables.

To activate document handling for selective tables.

Go to Organization administration -> Setup -> Document management -> Document management parameters

Check the flag “Use active document tables


Once specified here then document handling is active only for selective list of tables. To specify the active list of tables  go to Organization administration -> Setup -> Document management -> Active document tables. Document handling is now only enabled for the selected tables in a controlled mode.


Activate document handling for all tables.

Simply unchecking the  “Use active document tables” in Document management parameters makes it activate for all tables. There is a limitation here, in the case where document handling is enabled for all tables the system verifies if the table has edit/delete permission. Only if it is the case document handling is activated otherwise it is disabled. E.g This means tables like Salestable/Salesline will have permission to add/edit documents while forms that uses tables like custInvoiceJour, vendinvoice jour will have document handling disabled.

User’s may ask for document handling to be activated on these read only  forms. In these case there is a way out.

Go to Organization administration -> Setup -> Document management -> Active document tables and enter the table name, say “VendInvoiceJour” also make sure to check the “Always enabled” flag. This is very important since this means the document handling is enabled irrespective of the table permission. So this way you can activate document handling for read only tables


\Forms\DocuView\Methods\doReSearch – Go to this method

on line Number: 130 – add the following line,

allowEditBasedOnActualForm = true


Setting this will enable you to use the full document handling feature even for read only forms.

SSRS tip: No row message in Dynamics Ax SSRS 2012

September 9, 2013 13 comments

Some sections in your report may not have data but the header sections  might print. In these cases to make it informative for the user a “No data available” message might be helpful since the user is then assured that there is no data for that particular data section. This tip will guide you on how to setup “No data available”.

Select the Tablix/List/Matrix control where you want the message to be available and open the properties window, Find the property “NoRowsMessage”. This property can be filled in with text or for dynamic text using expressions. Type in something like “No data available”


When there is no data for that particular section SSRS automatically prints the text under “NoRowsMessage”

For more tips and learning about SSRS – AX 2012 order the book Dynamics AX 2012 Reporting Cookbook authored by me.


SSRS tip: Take care that VS and AX client are in the same layer for SSRS – Dynamics AX 2012

September 5, 2013 14 comments

Some times when you use configuration files to start your AX client like this in the image and also work on visual studio, make sure your default client configuration is pointing to the same layer as in the configuration file.


This is because the Visual studio opens in the layer that is specified in the default settings in AX Client Configuration window. Though your AX client is on VAR layer if your default client configuration setting is pointing to the USR layer then the visual studio reporting project gets saved to the USR layer. You end up in deleting and reimporting the entire project. So make sure to verify the layer setup before you start working on reporting projects.

To setup the default layer configuration, 

Open the run window and type axclicfg

In the window that opens create a new configuration or on the existing configuration go to the Developer tab and verify the layer information including the license


For more tips and learning about SSRS – AX 2012 order the book Dynamics AX 2012 Reporting Cookbook authored by me.


Dynamics Ax 2012 Security How To – Book Review

December 21, 2012 2 comments

Packt has recently come up with a Security How-To book to followup it’s Ax2012 releases.



Thanks to Packt for asking me to review their book and I appreciate the author Ahmed Mohamed Rafik Moustafa for his work.

First of all, this is not the regular books that keeps you stay away from reading by the sheer numbers of page. I like the fact that Packt is trying to come up with more shorter series that are interesting and easier to read. The security How To is a Hand book with less pages and more content. It is something that you can tap on to your smart devices, start reading on your way to meet your client and be fully prepared.

The book inclines more towards administrators and consultants but it still dedicates few of the topics to the hard core developers who double as consultants. Segregation of duties to meet Sox Compliance or similar standards was not at least a cake walk with the previous versions of Dynamics Ax. Ax 2012 has made it much easier for functional users/administrators to carry out this operation, but that also means that you need to understand this new framework.  For that matter this book can come handy to get you prepared to face this new framework.

Right now Packt is running a offer and you will be able to buy this book for a little more than a dollar and i definitely recommend that you do it, since the take away from it is worth it. Click here to buy it

Also pre-order the upcoming book on Ax2012 Services by Klass Deforche and Kenny Saelen




E-Commerce in Retail with Dynamics Ax 2012 R2

October 24, 2012 2 comments

– This is one of the mind blowing features that was showcased through the key note

Data from DAX: The entire data of the ecommerce website is driven automatically through Dynamics Ax. What this means is that you keep your site up to date just through Dynamics Ax. (For the techies: There are query webparts now that pull the data from Ax

Order generation: A website is just another channel, so when a order is placed through the ecommerce portal it actually creates sales order at the backend

Catalog: Item catalogs show up based on the product attributes. So the portal looks up to dynamics ax attribute for catalog

Product Search by attributes: You can specify the criteria for each product and the search is automatically enabled on the eCommerce portal. Eg. Like Color, Size etc.

Multiple Device support: A whole website was showcased where the template is driven by sharepoint and data by Dynamics Ax. The templates are device dependant, which means there is an abstraction between data and the rendering. This helps you to have device based templates. So tosupport multiple devices like mobile, desktop all you need to do is to set the right templates

– The e-commerce alltogether has come up as the most key functionality in the Ax for retail section and did attract a lot of  attention from the audience

E-commerce portal with sharepoint 2013

Notes from the Dynamics Ax2012 R2 Technical Conference

October 24, 2012 1 comment

Hello Folks,

I’m jotting all my notes here so that you and i can share it later. I’ll update all my notes and link it to this post for the rest of the days in the conference also.

E-Commerce for Retail


Data Partitioning

Application Life Cycle Management


— Life Cycle Management

Programming Improvements (LINQ, Solver Foundation, Code Upgarde)

What’s coming in the Future Ax 201x ? Key note Day 2

VPC and Data from the Conference  – Download Link to Information source(Access required)

Welcome to the Dynamics AxTechnical 2012 Conference

October 23, 2012 Leave a comment

Hello folks

I’m on the first day of Dynamics Ax Technical conference 2012. It’s live and kicking. The keynote session by Christian and Hal Howard has just completed. Here is quick notes from the session.

So the focus of r2 is on
– improvement to the bi capabilities (power view and interactive charts)
– budget planning through excel
– whole lot of things done on the retail part
— multi device support
— deployment enhancements
— pos customisations
— ecommerce (fantastic improvements with the whole portal being driven by dynamics ax)
– production improvements
— master planning decision explanations
— product Configurator improvements
— process manufacturing capabilities
– deployment changes
— single deployment across multiple countries and localizations
— more effective data partitioning to share data

More to come from the keynote sessions tomorrow related to lifecycle management.

I will also be attending the following session’s today, watch out this space or @casperkamal for updates.

Microsfot Dynamics Ax2012 Overview:Understanding the breadth of innovation Lachlan Cash and Rajesh dadhi

Solution Architecture: Using Solution Architecure in your implementation:Kim Shek and Arijit Basu

Understanding Data Partitions in Microsoft Dynamics Ax2012 R2: Amit KulKarni and Rajesh Dadhia

Increased visibility and Productivity using Master Planning in Dynaimcs Ax 2012: UlriK Molgaard Honore

Implementing Dynamics Ax at Lotus F1: Implementation Insights: Sri Srinivasan and Thomas Mayer