cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Portal - Subgrid hijack FetchXML

From inside the portal, I need to hijack the data returned by the entity form subgrid and inject a custom fetchXML query for the subgrid.  Any ideas how to accomplish this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Portal - Subgrid hijack FetchXML

you can't inject a FetchXML via JS, as the subgrid/any fetch associated runs in the server side you can't do that

 

but I see two other ways to achieve your goal (I am assuming you already made all possible filters you can via CDS view filters)

 

1 - you can remove the subgrid from your CRM form, and load the subgrid via liquid template, so you will define your fetch in your web template 

these links might help on that approach: 

https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/template-tags

http://dyn365apps.com/2017/09/14/dynamics-365-portals-liquid-templates-part-3-retrieve-data-using-fe...

 

2 - if what you need is to remove rows/columns based on simple criteria, you can loop your list via jQuery and remove the rows 

the below code locates the 5th row of an entity list and hides it, it is just an example of how you would achieve

var row5 = $(".entitylist").eq(0).find("tr")[5];
$(row5).hide();

 

View solution in original post

2 REPLIES 2
Highlighted
Solution Sage
Solution Sage

Re: Portal - Subgrid hijack FetchXML

you can't inject a FetchXML via JS, as the subgrid/any fetch associated runs in the server side you can't do that

 

but I see two other ways to achieve your goal (I am assuming you already made all possible filters you can via CDS view filters)

 

1 - you can remove the subgrid from your CRM form, and load the subgrid via liquid template, so you will define your fetch in your web template 

these links might help on that approach: 

https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/template-tags

http://dyn365apps.com/2017/09/14/dynamics-365-portals-liquid-templates-part-3-retrieve-data-using-fe...

 

2 - if what you need is to remove rows/columns based on simple criteria, you can loop your list via jQuery and remove the rows 

the below code locates the 5th row of an entity list and hides it, it is just an example of how you would achieve

var row5 = $(".entitylist").eq(0).find("tr")[5];
$(row5).hide();

 

View solution in original post

Highlighted
Solution Sage
Solution Sage

Re: Portal - Subgrid hijack FetchXML

Did my previous answer help with your issue? If yes, please give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (10,639)