Creating a UIBuilder Class in AX with Lookup for SSRS Report

by | Nov 30, 2015 | Development, Dynamics AX, Reporting

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

2 Comments

  1. Qaiser Siddique

    i followed all the steps , code is ok shows no error but on report parameter form when i select the parameter i get this error.

    Error executing code: FormStringControl (object), method Lookup called with invalid parameters.

    Stack trace

    (C)\Classes\FormStringControl\Lookup

  2. Brandon Carmichael

    Hello Qaiser:

    I tried to recreate the issue you describe, but I have not been able too. As such, I would suggest do a CIL build, clear cache(s), etc… I don’t believe it is report related but it wouldn’t hurt to refresh the dataset, followed up with a rebuild and deploy of the report. Does the parameter exists in the contract class?

    If my suggestions above do not work, we will need some more info. But my guess would be there may be an issue in the custom lookup method.

    Thanks,
    Brandon

Submit a Comment

Your email address will not be published. Required fields are marked *

Upcoming Events

april

08apr10:00 am10:30 amLicensing Preparedness for Dynamics 365 Customer Engagement

08apr12:00 pm1:00 pmMaking Project Information Management (PIM) a Priority

08apr2:00 pm2:30 pmFeatures in the Spring Release of Dynamics 365 Customer Engagement Users Can Take Advantage of Immediately

09apr11:00 am12:00 pmConfab With Stoneridge - Livestream - Portals

13apr11:30 am12:30 pmStoneridge Connect Online Keynote: Business Transformations Throughout History

14apr8:00 am5:00 pmStoneridge Connect Online - Day 1

15apr8:00 am5:00 pmStoneridge Connect Online - Day 2

15apr1:15 pm5:00 pmWhat’s New for Developers in Dynamics 365 Finance and Supply Chain Management – Online Workshop

16apr8:00 am5:00 pmStoneridge Connect Online - Day 3

22apr11:00 am12:00 pmPower BI and Reporting with Dynamics 365 Business Central

22apr2:00 pm2:30 pmNew Features for Power Apps Users

23apr11:00 am12:00 pmConfab With Stoneridge - Livestream - Internet of Things (IoT)

29apr10:00 am11:00 amStreamlining Customer Service and Enabling Your Sales Team with a Self-Service Portal

29apr12:00 pm12:30 pmUpdates to the Dynamics 365 Customer Engagement User Experience - What Technical Resources Need to Know

may

06may12:00 pm12:30 pmPower Apps Telemetry and AI Builder - Power Platform Updates

06may2:00 pm2:30 pmImprove Customer Experience with a Mobile Workforce Management Solution

07may11:00 am12:00 pmConfab With Stoneridge - Livestream - Manufacturing

13may12:00 pm1:00 pm3 Simple Sets Your Business Can Take to Embrace the Future of B2B E-Commerce

21may11:00 am12:00 pmEnterprise Asset Management and Manufacturing

About Stoneridge
Stoneridge Software is a unique Microsoft Gold Partner, with emphasis on partner. With specialties in Microsoft Dynamics 365, Microsoft Dynamics AX, Microsoft Dynamics NAV, Microsoft Dynamics GP and Microsoft Dynamics CRM, we focus on attracting the most knowledgeable experts in the field to our team, and prioritize delivering stellar solutions with maximum impact for your business. At Stoneridge, we are deeply committed to your results. Each engagement is met with a dedicated team, ready to provide thorough, tailored, and expert service. Based in Minnesota, we intentionally “step into your shoes,” wherever you are. We focus on what you care about, and develop trusting, long-term relationships with our clients.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X