
What is deep links in Microsoft Dynamics 365 for finance and operation? Deep links are shareable and secures URLs to a specific form. Optional filters can be passed so that when user will open the deep link and navigate to a specific form then it will show filtered data ore records. In Microsoft D365 FO, below library – Microsoft.Dynamics.AX.Framework.Utilities.UrlHelper.UrlGenerator is used to generate deep links using X++ .
Sample Code – Below is the sample code of developing & generating deep links for D365 FO forms and records using filter and ranges in form data source. In below example, i am generating the sharable URL (deep link ) of a form – CustAccount and applying a “CustAccount” filter on custTable datasource.
using Microsoft.Dynamics.AX.Framework.Utilities; // setting library/Dll reference class DeepLinkTest { public static void main(Args _args) { MenuItemNameDisplay menuItemName = menuItemDisplayStr(CustTable); // customer form MenuItemType menuItemtype = MenuItemType::Display; str filterformDataSource = formDataSourceStr(CustTable, CustTable); // filer datasource str filterFormDataSourceField = fieldStr(CustTable, AccountNum); // filter field UrlHelper.UrlGenerator generator = new UrlHelper.UrlGenerator(); System.Uri currentHost = new System.Uri(UrlUtility::getUrl()); generator.HostUrl = currentHost.GetLeftPart(System.UriPartial::Authority); generator.Company = curExt(); generator.MenuItemName = menuItemName; generator.MenuItemType = menuItemtype; generator.Partition = getCurrentPartition(); generator.EncryptRequestQuery = true; if(filterformDataSource) { UrlHelper.RequestQueryParameterCollection requestQueryParameterCollection; requestQueryParameterCollection = generator.RequestQueryParameterCollection; requestQueryParameterCollection.UpdateOrAddEntry(filterformDataSource, filterFormDataSourceField, "CustAccount"); // applying filter } System.Uri fullURI = generator.GenerateFullUrl(); Info(fullURI.AbsoluteUri); // getting deep link } }
One thought on “D365 FO – Create deep links, shareable, secured URLs in Microsoft Dynamics 365 for finance & operations”