Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

How to redirect user to a specific form record ID instead of the default View from SiteMap?

Like (0) ShareShare
ReportReport
Posted on 15 Feb 2023 07:28:15 by 1,710

Hello,

I am trying to find a way when the user clicks on the entity from the Site Map it should navigate him automatically to a specific form record ID.

For example in the field service module, we have the field service settings that take you directly to a specific form with record id as below:

 

Julien2_1-1676446053312.png

 

While adding the entity to the Site Map I know that we have the option URL and we can hardcode the App ID, Form ID, and Record ID but that won't work because the App ID and the Form ID might be changing from an environment to another when we deploy the solution.

 

powerusers.microsoft.com/.../859782

Kindly note that custom pages won't work with us, we want to open the model-driven form UI. 

  

What is the best way to achieve the above? Could you provide an example? 

Any help is greatly appreciated. 

Thank you! 

Categories:
  • EBMRay Profile Picture
    1,710 on 16 Feb 2023 at 18:56:25
    Re: How to redirect user to a specific form record ID instead of the default View from SiteMap?

    Hello @a33ik ,

    Thank you for your suggestion.

     

    I'll give it a try and get back to you.

  • a33ik Profile Picture
    3,304 Most Valuable Professional on 16 Feb 2023 at 12:02:01
    Re: How to redirect user to a specific form record ID instead of the default View from SiteMap?

    Hello,

    I would recommend to use the following approach:

    1. Create an Html/JS webresource that will serve as a "redirector".

    2. In the code of your webresource write a JavaScript that will query for an AppId (based on the name or something like that). There is no need to do anything with FormId because it stays the same if you use solutions to move customizations between your environment.

    3. Having the AppId and FormId you can use Xrm.Navigation.navigateTo to open the right form.

    4. Embed this Html/Js webresource to your SiteMap.

     

    Good luck.

  • EBMRay Profile Picture
    1,710 on 16 Feb 2023 at 06:04:21
    Re: How to redirect user to a specific form record ID instead of the default View from SiteMap?

    Hello @AhmedSalih ,

     

    Thank you for your reply.

     

    How can add the JS onClick of the entity from the sitemap? OnLoad event will only work inside the form.

     

    The main goal is whenever we click on the table from the sitemap it should automatically navigate us to that page.

     

    Awaiting your response.

    Best regards,
    Julien

  • AhmedSalih Profile Picture
    6,678 Super User 2025 Season 1 on 15 Feb 2023 at 18:52:57
    Re: How to redirect user to a specific form record ID instead of the default View from SiteMap?

    Hello, @Julien2, I would use Environment Variables and use RetrieveEnvironmentVariableValue Function in a Web Resource that will be triggered on the OnLoad event.

    Here is an example: 

    https://mytrial365.com/2021/03/15/get-environment-variables-value-using-javascript/

     

     

    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


     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,077 Most Valuable Professional

Leaderboard

Featured topics

Loading started