Answered by:
CRM 2011: Modify the fetch xml of an associated view (Left Navigation) dynamically

Question
-
Hi,
we have a requirement to show all related records fr the current record and it's child entity records in one single view.
For example, I want to show all the Activities related to an Account, it's child contacts, it's child cases etc in one view. If we add a subgrid I know we can dynamically set the fetchxml for the grid to change the results.
subgridElement.control.setParameter("fetchxml", dynamicFetchxmlstring);
Can we achieve the same functionality for a left navigation item? - i.e. When I click on the 'Activities' left navigation on an Account form I want to see all related Activites (parent, children). So is there a way to set the fetchxml dynamically when the left navigation link pane loads ? Is it supported?
Please help.
Thanks
- Edited by Rajesh Achanta Tuesday, September 3, 2013 4:57 PM
Tuesday, September 3, 2013 4:57 PM
Answers
-
Hi,
About showing all activities including contacts and cases, if I am not wrong, they are shown on the account by default. About a JavaScript to change the Fetch of a view, you could exactly do the same you have been done. On the click of the left navigation item (this is not a supported builtin handler) you could change the Fetch of the view and replace it with your own.
- Marked as answer by Payman BiukaghazadehEditor Tuesday, October 15, 2013 5:37 PM
Tuesday, September 3, 2013 5:54 PMModerator -
You could also write a plugin on pre-RetrieveMultiple and modify the query. See similar question:
If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".
- Marked as answer by Payman BiukaghazadehEditor Tuesday, October 15, 2013 5:37 PM
Tuesday, September 3, 2013 9:03 PM
All replies
-
Hi,
About showing all activities including contacts and cases, if I am not wrong, they are shown on the account by default. About a JavaScript to change the Fetch of a view, you could exactly do the same you have been done. On the click of the left navigation item (this is not a supported builtin handler) you could change the Fetch of the view and replace it with your own.
- Marked as answer by Payman BiukaghazadehEditor Tuesday, October 15, 2013 5:37 PM
Tuesday, September 3, 2013 5:54 PMModerator -
You could also write a plugin on pre-RetrieveMultiple and modify the query. See similar question:
If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".
- Marked as answer by Payman BiukaghazadehEditor Tuesday, October 15, 2013 5:37 PM
Tuesday, September 3, 2013 9:03 PM -
Hi,
I was just mentioning the activities as an example, our requirement is on a custom entity. The out of box functionality will not show all related records on custom entities. So can we modify the associated view fetchxml on a custom entity ?
Wednesday, September 4, 2013 9:52 AM -
You could also write a plugin on pre-RetrieveMultiple and modify the query. See similar question:
If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".
Hi, thanks for the response. We don't want to use the retrieve multiple plugins because of the performance overheads. So wondering if this can be achieved using javascript ?Wednesday, September 4, 2013 9:53 AM -
Then you would have to explore Payman's suggestion and try to filter the view on click of the relationship. Otherwise you could add a subgrid to your form and filter it that was since you already know how to do that.
If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".
Wednesday, September 4, 2013 9:55 AM