
Hello everyone,
I'm looking to integrate a link in Power BI that will allow me to access the details of an order directly in Dynamics 365 Finance & Operations.
Currently, when I try to view an order, I use the following URL:
https://[Dynamics365Instance].dynamics.com/?mi=SalesTableDetails&SalesId=[OrderNumber]
However, clicking on an order simply takes me to the unfiltered SalesTableListPage rather than directly showing the specific order details.
My objective is:
🔹 Either to directly access the details of a specific order,
🔹 Or, alternatively, to get to the list of orders with a filter applied to show the selected order.
I have findtwo potential approaches:
1-Manually Constructing a Filtered URL:
The idea is to build an URL that passes a JSON-formatted filter parameter. For instance, to filter by the order number (e.g., SalesOrderID) for the Sales Order table, the parameter might look like:
{"Parameters":[{"DataSource":"SalesOrderTable","FieldValues":[{"Field":"SalesOrderID","Value":"[OrderNumber]"}]}]}
https://[Dynamics365Instance].dynamics.com/?cmp=YourCompany&mi=display:SalesTableDetails&q=%7B%22Parameters%22%3A%5B%7B%22DataSource%22%3A%22SalesOrderTable%22%2C%22FieldValues%22%3A%5B%7B%22Field%22%3A%22SalesOrderID%22%2C%22Value%22%3A%22[OrderNumber]%22%7D%5D%7D%5D%7D
Dynamics 365 F&O has a built-in deep linking functionality that generates secure URLs using the UrlGenerator class in X++. This method creates links with parameters that are both URL-encoded and encrypted.
Here’s an example of an X++ snippet that generates such a link:
class OrderDeeplinkGenerator
{
public static str generateDeeplink(str _orderNumber)
{
UrlHelper.UrlGenerator generator = new UrlHelper.UrlGenerator();
System.Uri currentHost = new System.Uri(UrlUtility::getUrl());
generator.HostUrl = currentHost.GetLeftPart(System.UriPartial::Authority);
generator.Company = curext(); // Gets the current company context
generator.MenuItemName = menuItemDisplayStr(SalesTableDetails); // Adjust to your menu item name
generator.Partition = getCurrentPartition();
generator.EncryptRequestQuery = true; // Enables encryption for security
generator.RequestQueryParameterCollection.UpdateOrAddEntry(
formDataSourceStr(SalesOrderTable, SalesOrderTable),
fieldstr(SalesOrderTable, SalesOrderID),
_orderNumber
);
System.Uri fullURI = generator.GenerateFullUrl();
return fullURI.AbsoluteUri;
}
}
Additionally an approach using Dataverse and virtual entities where you can create deep links without X++ :
Thanks to Henrik Marx Larsen https://www.linkedin.com/pulse/deep-links-dynamics-365-finance-operations-records-using-larsen-d9zvf/
An example deep link using this method looks like:
https://[Dynamics365Instance].dynamics.com/?cmp=usmf&mi=action:SysEntityNavigation&entityName=mserp_entassetmaintenancerequestv2entity&entityGuid=[RecordGUID]
However, it does require that you have access to Dataverse and that the virtual entities are configured properly in your environment. If you don't have Dataverse access, as i do, then this option might not be viable.
Has anyone found another approach that effectively enables direct access to a specific order (or a filtered order list) from Power BI? Any insights or suggestions would be greatly appreciated.
May be there's a way to catch all Get Link in sales orders?