web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal - Subgrid hijac...
Power Pages
Unanswered

Portal - Subgrid hijack FetchXML

(1) ShareShare
ReportReport
Posted on by 85

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?

Categories:
I have the same question (0)
  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    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-fetchxml/

     

    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();

     

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    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.

  • nerdifand Profile Picture
    on at

    Dear Oliver,

    when we use an entity form to show record details (opens in a pop-up) and want to display a subgrid with specific conditions from the record context, is there a way to populate the entityform with a table created in liquid?

    also my research showed, that using a plugin und retrieveMultiple message could do this, but i read pagination and sorting will fail, and also i dont understand how to limit this to specific places (forms).

     

    sunny greetings

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi @nerdifand 

     

    If you have an entity form with subgrid.. what kind of filter are you looking for here? Via Dataverse/D365, you can set that subgrid to show a specific view, and perform the filters on that level. You can also force the subgrid to show only related (child) records.

    If you need anything more custom, you can use the approach I mentioned earlier in this thread and create a custom grid via Liquid, and inject this via JS in your form.

     

    With regards the RetrieveMultiple Plug-in, that's a very bad practice, basically that Plugin is triggered for any query you perform against the entity, via Portals, via Model-Driven App, via API, etc. Even if you add certain conditions in your Plugin, you might still face unwanted behaviour/results as part of your plugin.

     

    If you have any other questions might be better to create a new thread, as this one is already resolved.

    thanks 

  • Himanshu Kamboj Profile Picture
    4 on at
     
    I also have the same query, can you please suggest the solution there.
    Because the link provided by you here in this post is not working.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard