Navigating to a D365FO entity without a deep link

It’s possible to create shareable, secured URLs (deep links) using the Get a link menu available in most forms.

The generated link will have an encrypted encoding of the filters to apply to the target form in the q parameter, e.g.


However, since the filters are encrypted, it isn’t possible to generate a deep link outside of D365FO.

If you have an internal application that holds the primary key of an entity (e.g. the AccountNum of a Customer or Vendor), it can be a challenge to navigate your users to D365FO without either setting up an integration to generate and persist the deep links for each entity or provide a deep link lookup service.

It would be far easier if we could navigate directly and so long as we are comfortable with the security implications of embedding unencrypted filters within query strings, we can make this happen by creating a Chain of Command extension for the FormRun class:

public final class FormRun_Class_Extension
/// <summary>
/// This allows unencrypted setting of the recordContext via the q querystring parameter:
/// q={"Parameters":[{"DataSource":"CustTable","FieldValues":[{"Field":"AccountNum","Value":"C123456789"}]}]}
/// </summary>
/// <param name = "_recordContext"></param>
/// <returns></returns>
public boolean applyRecordContext(str _recordContext)
str recordContext = _recordContext;
//Basic check for JSON in the recordContext is assumed to be an unencrypted requestQueryParameter
if (strStartsWith(recordContext, '{') && strEndsWith(recordContext, '}') && strContains(recordContext, ':'))
var generator = new Microsoft.Dynamics.AX.Framework.Utilities.UrlHelper.UrlGenerator();
generator.EncryptRequestQuery = false;
//Encrypt the requestQueryParameter and pass it on
generator.EncryptRequestQuery = true;
recordContext = generator.GenerateRequestQueryString();
return next applyRecordContext(recordContext);

This allows us to also use the unencrypted format for internal navigation:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at

Up ↑

%d bloggers like this: