Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Relationship parameter in Xrm.Navigation.navigateTo

(0) ShareShare
ReportReport
Posted on 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
    Henry J. 5,237 on at
    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

  • 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
    Linn Zaw Win 3,407 on at
    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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans