Creating a UIBuilder Class in AX with Lookup for SSRS Report

By Eric Meissner | November 30, 2015

I ran into a scenario where I wanted to filter the dataset of one of the report parameters in an SSRS report in AX. I had a report parameter that had a relation to the DirParty table, so it was returning all records in the DirParty table. I only wanted the sales rep records to appear in the dropdown. To accomplish this I created a UIBuilder class in AX, outlined in the steps below.

The sales responsible field has a tie to the DirParty table. So sales responsible is a recid that pulls in the Name from DirParty table. The problem is that it is pulling all records in from DirParty table, which is confusing for users.

Commission Summary

After creating the lookup in the UIBuilder class, the record set return in drop down is limited to only Sales Reps. This makes it much easier for users to select or search for person they want to select.

Commission Summary in AX 2012

Create a new UIBuilder class that extends the SrsReportDataContractUIBuilder. Then you will need to create a variable of the Data Contract class that will utilize the UIBuilder.

UIBuilder Class in AX

Next you’ll need to override the build method. Then, add dialog fields of the report parameters in the Data Contract class.

Data Contract Class

Next you’ll need to override the postBuild method. Create a dialog field and ‘bind’ it to the report parameter you want to put a search on. Then add the lookup method to the dialog field so it will get called.

Commission Summary UIBuilder

This is the method that was created to perform the lookup.

Commission Summary UIBuilder

Last you will need to change the data contract to make tie to the UIBuilder class.

UIBuilder Class

Related Posts


Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.

Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!