Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id : 63cu1mXyDzDfv6ONCjGkCn
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Relationship parameter in Xrm.Navigation.navigateTo

Like (0) ShareShare
ReportReport
Posted on 13 Jul 2020 13:19:53 by 5

Hi Guys,

My goal is open some form of record using Xrm.Navigation.navigateTo method and show an associated view of the Documents entity (Sharepoint locations) at the same time. The form does not have the Documents subgrid but the form has Documents in Related tab (Navigation items). So, I tried to call navigateTo method passing a relationship object in pageInput parameter but it had no effect to display an associated view for Documents.

My parameters:

var pageInput = {
    pageType: "entityrecord",
    entityName: "vs360_job",
    entityId: "cb03f692-686a-e811-814e-480fcff4b171",
    relationship: { attributeName: 'regardingobjectid', name: 'vs360_job_SharePointDocumentLocations', navigationPropertyName: 'regardingobjectid_vs360_job', relationshipType: 0, roleType: 1 }
};
var navigationOptions = {
    target: 2,
    height: {value: 80, unit:"%"},
    width: {value: 70, unit:"%"},
    position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)

Docs:
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto


Can anyone have experience with the relationship parameter? Is it possible to implement my wish to display associated view?


Kind regards
 
  • Suggested answer
    Henry J. Profile Picture
    5,237 on 20 Jul 2020 at 22:11:29
    RE: Relationship parameter in Xrm.Navigation.navigateTo

    I don't think this is achievable (SharePoint Documents cannot be displayed as a subgrid on a form).

    What is achievable is to display a Document Tab on your form, as documented (as a preview feature), here:
    https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/add-documents-tab-entity-main-form

    Then as Linn said, you might be able to automatically set focus on that document tab with a form script (but that might be disturbing from a user experience perspective if opening the form always defaults to that tab).
    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/setfocus

    Henry

  • dmitriy andreyanov Profile Picture
    5 on 15 Jul 2020 at 13:37:00
    RE: Relationship parameter in Xrm.Navigation.navigateTo
    [quote user="Linn Zaw Win"]

    I think the relationship parameter is not what you think it is. I guess it is not the parameter to focus the specified associated tab of the record that you opened. I have raised an issue in GitHub of the Docs and I will get back to you when I get a response.

    https://github.com/MicrosoftDocs/powerapps-docs/issues/1589

    I do no think it is possible to implement your requirement to focus and display associated view on load of the form by navigateTo() client API. Please just consider adding the subgrid to the form and focus the tab with the subgrid onLoad() of the page by checking the formParameters passed by the navigateTo() client API. (and hide the tab if the custom formParameters is not found when the record is normally opened by the user)

    [/quote]

    Thank you Linn,

    Just I thought that "relationship: (Optional) Object. Define a relationship object to display the related records on the form" parameter description from docs describes my wish to display related tab on a form. It seems it's not possible (sad). I investigated system js files of Dynamics 365  but I found nothing that the relationship parameter handled. Of cause, I will wait for comments in GitHub to find out about this parameter more.

    I will try to implement your offered solution

  • Verified answer
    Linn Zaw Win Profile Picture
    3,407 on 14 Jul 2020 at 20:42:59
    RE: Relationship parameter in Xrm.Navigation.navigateTo

    I think the relationship parameter is not what you think it is. I guess it is not the parameter to focus the specified associated tab of the record that you opened. I have raised an issue in GitHub of the Docs and I will get back to you when I get a response.

    https://github.com/MicrosoftDocs/powerapps-docs/issues/1589

    I do no think it is possible to implement your requirement to focus and display associated view on load of the form by navigateTo() client API. Please just consider adding the subgrid to the form and focus the tab with the subgrid onLoad() of the page by checking the formParameters passed by the navigateTo() client API. (and hide the tab if the custom formParameters is not found when the record is normally opened by the user)

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans
Loading complete