[Model-driven apps] Deep link a MDA to open on a specific form tab

Have you ever needed to open a form with a focus on a tab or a section dynamically from a url ? This blog explains in detail an approach to implement this functionality. You’ll need a few lines of JS code, don’t worry the API client will do all the work for us.


We will use the Account table and the standard Account form. The goal is to automatically navigate to an “X” tab by passing his name as a parameter to our URL. For example, the following URL will open an account with a focus on a tab named “DETAILS_TAB”:


How does it work ?

First, we will need to create a Parameter for our form. It can be done within the classic designer:

  • Click on Form Properties
  • Then go to the Parameters tab
  • Add your parameter. In my case, I named it “tab_name”
  • Save & Publish the form

Some JS code will be used to set the focus to a tab Dynamically. The tab’s name will be captured from the URL:

  • Create a JavaScript web resource
  • Implement the logic using the OnLoad Function
  • Register the function in your form
Web Resource Details:
var MEA = window.MEA || {};
var accountForm = MEA.accountForm || {};
(function () {
this.OnLoad = function (onLoadContext) {
var formContext = onLoadContext.getFormContext();
var extraParameters = Xrm.Utility.getGlobalContext().getQueryStringParameters();
var tabName = extraParameters["tab_name"];
if(tabName != undefined){
var defaultTabObj = formContext.ui.tabs.get(tabName);
view raw AccountForm.js hosted with ❤ by GitHub
Event Handler:

All you need is to construct the URL. First, navigate to an account record and copy the URL:


Then, simply add an extraqs (&extraqs=tab_name=DETAILS_TAB) as below:


The name of the tab can be found easily in the designer. In my case, I used “DETAILS_TAB”:

Hope it helps …


2 thoughts on “[Model-driven apps] Deep link a MDA to open on a specific form tab

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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