Notifications
Announcements
I want to create a deep link for a model driven app
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?
Hello, @Robert94, EDITED 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
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.
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?
Hi @Robert94 ,
You will need to create a custom parameter in your form. This can be done on the classic designer.
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/
@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?
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" ?
I will write a blog post today explaining all the steps !
Never mind I figured it out!For future users that are reading this, this is how I Configured the event
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.
Oh ok, nice!
https://xrmtricks.com/2022/09/12/model-driven-apps-deep-link-a-mda-to-open-on-a-specific-tab/
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 759 Most Valuable Professional
Michael E. Gernaey 310 Super User 2025 Season 2
Power Platform 1919 228