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...
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
 
I have the same question (0)
  • Verified answer
    Linn Zaw Win Profile Picture
    3,407 on at

    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)

  • dmitriy andreyanov Profile Picture
    5 on at
    [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

  • Suggested answer
    Henry J. Profile Picture
    5,237 on at

    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

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
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 39

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans