web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Deep link a Model Driv...
Power Apps
Unanswered

Deep link a Model Driven App to open on a specific tab (form tab)

(0) ShareShare
ReportReport
Posted on by 520

I want to create a deep link for a model driven app

Robert94_1-1662713717014.png

In this example, I would want, when opening the url, to point straight to Stakeholders tab, instead of the first one (Project Charter).
Any ideas?

 

Categories:
I have the same question (0)
  • AhmedSalih Profile Picture
    6,678 Moderator on at

    Hello, @Robert94EDITED you can accomplish this using Web resource and JavaScript.

    You will use the Web Resource that you will create in the OnLoad event of your Form.

     

    You JavaScript Code can be something like this: You will use the SetFocus method.

     

     

     

    function DefaultSelectedTab(executionContext) {
     var formContext = executionContext.getFormContext();
     var defaultTab = formContext.ui.tabs.get('StakeHolderTabName'); //Tab Name is the name of the 
     defaultTab.setFocus();
    
    }

     

     

     

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • Robert94 Profile Picture
    520 on at

    Hi Ahmed, thank you for your response. But am I able to do this for multiple Tabs using different links of that project, or am I just changing permanently the default tab the project is being opened?
    What I wanted to do, in this case for the stakeholder tab I would have a link that only when that link is used it will point to the stakeholder tab, else if the original link of the project is loaded without anything extra added, it should load as usual with the first tab. That`s what I meant with bein deep linked.

  • Robert94 Profile Picture
    520 on at

    Regarding to the code you wrote, I think what we need to do is to replace "StakeholderTabName" to a dynamic value that is brought from the url, for example:
    https://www....com/....&varTab="tabname"

    where "tabname" is the id/name of the tab that I would input manually.

    You think this is possible? If so, how can we create that variable?

  • Verified answer
    meelamri Profile Picture
    468 on at

    Hi @Robert94 , 

     

    You will need to create a custom parameter in your form. This can be done on the classic designer.

    • Click on Form Properties
    • Then go to the Parameters tab
    • Add your parameter. In my case, I named it "tab_name".

    melamri_0-1662980313055.png

     

    Then you can add this parameter to your URL like below. 

     

    https://yourorg.dynamics.com/main.aspx?appid=08d0868e-b4e4-eb11-bacb-000d3a9587a6&pagetype=entityrecord&etn=account&id=7046cbf5-fe9a-ec11-b401-0022486fa9c1&extraqs=tab_name=DETAILS_TAB

     

    This URL allows going to the tab DETAILS_TAB. Of course this is not automatic, you will need to add the logic to your JS script at load time.

     

    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);
     defaultTabObj.setFocus();
     }
     };
    }).call(accountForm);
    

     

    Please tick Accept as solution if the answer is useful.

    https://xrmtricks.com/

  • Robert94 Profile Picture
    520 on at

    @melamri thank you for your response,
    I have 2 questions if you could help me a bit more,
    1. I`m not sure how to configure the event for the library, could you help me with that? What to check and what to write in those 2 boxes, for your specific JS code?

    Robert94_1-1662989510227.png

     

    2.This is the inspect code of the first tab, what exactly is the tab_name from here? Is it the li id aka "tab1_1" ?

    Robert94_2-1662989562975.png

     

     

  • meelamri Profile Picture
    468 on at

    I will write a blog post today explaining all the steps !

  • Robert94 Profile Picture
    520 on at

    Never mind I figured it out!
    For future users that are reading this, this is how I Configured the event

    Robert94_1-1662991458936.png
    And the tab_name is the name of the tab that you set up in the Display options of the tab (in the form).

    Well done @melamri . I don`t think this solution exists anywhere on the internet right now. Truly appreciate your effort on making this possible. Thank you.

     

  • Robert94 Profile Picture
    520 on at

    Oh ok, nice!

  • Verified answer
    meelamri Profile Picture
    468 on at
  • meelamri Profile Picture
    468 on at

    You are welcome @Robert94 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard