web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Drill through action - Go to URL SSRS report

(0) ShareShare
ReportReport
Posted on by 20

Hello, 

I have come across difficulties when working with drill through action in SSRS reports. 

Scenario :

I developed a SSRS report in which I have a field named "MainAccount" that must open the LedgerTransAccount form giving the right date range and the right MainAccountId. So I had to pass different parameters belonging to different formDataSouces : AccountingDate - GeneralJournalEntry and MainAccountId - GeneralJournalAccountEntry.

So I had to implement this method : (I followed this article : Create shareable, secured URLs (deep links) - Finance & Operations | Dynamics 365 | Microsoft Learn)

  private str CreateHyperlinkForMainAccount(Recid _mainAccountRecId, date _startDate, date _endDate)
    {
        IApplicationEnvironment env = EnvironmentFactory::GetApplicationEnvironment();
        str currentUrl = env.Infrastructure.HostUrl;
        System.Uri currentHostUrl = new System.Uri(currentUrl);
     
        UrlGenerator generator = new Microsoft.Dynamics.AX.Framework.Utilities.UrlHelper.UrlGenerator();

        generator.MenuItemName = "MENUITEM";
        generator.MenuItemType = MenuItemType::Display;
        generator.HostUrl = currentHostUrl.GetLeftPart(System.UriPartial::Authority);
        generator.Company = curExt();
        generator.EncryptRequestQuery = true;
        generator.Partition = getCurrentPartition();

        var requestQueryParameterCollection = generator.RequestQueryParameterCollection;

        requestQueryParameterCollection.AddRequestQueryParameter(
                            "GeneralJournalAccountEntry",
                            "MainAccount",
                            int642Str(_mainAccountRecId)
                        );

        requestQueryParameterCollection.AddRequestQueryParameter(
                            "GeneralJournalEntry",
                            "AccountingDate",
            SysQueryRangeUtil::dateRange(_startDate,_endDate));

        System.Uri fullURI = generator.GenerateFullUrl();

        return fullURI.AbsoluteUri;
    }

The URL generated is stored in a field "Hyperlink" in my report temporary table. Next step I did this to ensure the redirection ; 

pastedimage1682517516455v2.png

Problem : 

All is working fine in my development environment but when deployed in UAT environment I get the error message "Object not set to a reference" when I click on the field. 

pastedimage1682517535539v3.jpeg

However, when I right click -> Open in a new Window or Open in a new Tab, link is working fine and it opens the right form with the right parameters values. I am even able to see the link when I hover on the field and it looks correct. 

Has anyone an idee or a guess that I can work on ? 

Much appreciated. Thanks in advance :) 

  • Anton Venter Profile Picture
    21,339 Super User 2026 Season 2 on at

    Can you see if the URL created propery in the UAT environment (in the temp. table). Compare the URLs in Dev and UAT.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 232 Most Valuable Professional

#3
Aayush Tiwari Profile Picture

Aayush Tiwari 222

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans