I am trying to create a custom button on the command bar that when clicked shows the related records in a view. I can open the view in the dialog but can't figure out if there is a way to filter it.
Any help is appreciated!
Thanks
Excellent, thank you
You can get the View Id by opening the view for edit in the classic editor and looking at the URL. Near the end of the URL you will find a urlencoded string for the Id. Copy the GUID from there and that is the view ID.
It will look something like:
...id=%7Bd5d926d9-5d3a-471d-9c19-4ff7772afbe5%7D
Where the ID is the d5d926d9-5d3a-471d-9c19-4ff7772afbe5 portion in the middle there.
How does the ViewId work? Where do I find the ViewId of my views?
That pane navigation is in the same feature set as the new Custom Pages. They are not documented perfectly yet, but the documentation does reference that the pane.navigate method is 'similar' to navigateTo. If it is similar enough, then it should also accept a viewId input the same as navigateTo.
Hi!
@cchannon I did think about that and it is my backup plan, but I would prefer it to be a model view.
@rampprakash this is actually better! But it still doesn't show a filtered view. Any thoughts on that?
Hello @tchristy99,
There was an awesome behavior which was launch recently.
Xrm.App.sidePanes.createPane({
title: "Accounts",
paneId: "AccountList",
canClose: true
}).then((pane) => {
pane.navigate({
pageType: "entitylist",
entityName: "account",
})
});
Try using the above function to open it in Side Pan instead of Dialog.
Let me know if you want a dialog still, i can help you out.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com
Have you considered using the new Custom Pages feature to accomplish this?
You could open the page as a side panel or as an overlay, easily defined in your navigateto request...
You could quickly create any custom filtered view you want in an easy canvas apps experience...
And you could trigger the opening from your ribbon button using Javascript or even simple PowerFX syntax...
Pretty cool stuff.