Skip to main content

Notifications

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
    Anton Venter 19,493 Super User 2025 Season 1 on at
    RE: Drill through action - Go to URL SSRS report

    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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans