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 ;
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.
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 :)
Can you see if the URL created propery in the UAT environment (in the temp. table). Compare the URLs in Dev and UAT.
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156