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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Default Form for Lookup Values

(3) ShareShare
ReportReport
Posted on by 37
My Contacts table has a   custom column called Role, the Role values are Role A and Role B 
My Intakes table has 2 lookup columns where the full name for associated record as Role A goes and another column for contacts with the full name for the associated record as Role B goes. They will never be the same contact
 
My intakes main form has both lookup columns When user clicks on FullNameRoleA lookup value I want them to go to a different default contacts form then if they clicked on FullNameRoleB  
 
Is that possible? 
 
thank you 
 
Categories:
I have the same question (0)
  • CU25071753-1 Profile Picture
    13 on at
     
    You can dynamically switch the form using JavaScript to achieve this. On the contact table, for Onload event, you can register a script to show form A if the Role is Role A and to show form B if the role is Role B. You can refer the following blogs for code samples -
     
     
    Hope this helps!
  • André Arnaud de Calavon Profile Picture
    300,917 Super User 2025 Season 2 on at
    Can you tell us what Dynamics 365 application this question is related to? There are several different solutions in the Dynamics 365 family, like: Sales, Finance, Supply Chain Management, Project Operations, and Customer Insights.
  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at

    Hi there 👋

    Thanks for your question!

    Yes, it’s possible to direct users to different forms based on the lookup field they click—though it requires some customization.

    ✅ Here’s how you can approach it:

    1. Use JavaScript on the form to detect which lookup field was clicked.
    2. Based on the field (e.g., FullNameRoleA vs FullNameRoleB), you can use the Xrm.Navigation.openForm method to open a specific form for the related contact.
    3. You’ll need to pass the formId of the desired contact form and the record ID of the selected contact.

    📌 Important Notes:

    • Make sure both contact forms are published and accessible.
    • This approach works best in model-driven apps.
    • You may need to disable the default behavior of the lookup field to avoid conflicts.

    Let me know if you’d like help with the JavaScript snippet or form setup!

    ✅ Please mark this reply as helpful if it answered your question.
    Best regards! 👋

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans