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 :
Customer experience | Sales, Customer Insights,...
Unanswered

How to update the subgrid view fetch(link entity filter) dynamically?

(0) ShareShare
ReportReport
Posted on by 425
Hi all,
I have a program Entity and another entity is "Allocation".
This Allocation Entity Dont have the Direct Relationship with Program.
"Allocation" has lookup of entity "Lender", has lookup of entity "LegalName", has lookup of entity "Program".
So, I have added the subgrid of "Allocation"  entity on program entity and onLoad I am passing the filter in Allocation entity subgrid, but I am receiving and error pop-up
error is: 'allocation' entity doesn't contain attribute with Name = 'program' and NameMapping = 'Logical' 
I am using Grid control to set the FetxhXml Filter
                gridContext.setFilterXml(FetchXml);              
                formContext.getControl("gridname").refresh();
FetchXml 
 "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +
                    "<entity name='allocation'>" +      
                    "<link-entity name='account' from='accountid' to='lender' link-type='inner' alias='aa'>"+
                    "<link-entity name='legalname' from='alenderid' to='accountid' link-type='inner' alias='ab'>"+
                    "<filter type='and'>"+
                     "<condition link-entityname='ab' attribute='program' operator='eq'  value='"+programId+"' />"+
                    "</filter>"+            
                  "</link-entity>" +
                  "</link-entity>" +
                    "</entity>" +
                    "</fetch>";

The same fetch is giving the correct result in XRMTooBox(Fetch XML Tester).
As I have debugged the code and found that, the filter I am trying to add under link entity that is applying directly in the "Allocation" entity
fetch from the developer tool(Network):
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" savedqueryid="gh5e0c29-b72c-f011-8c4e-002248abcdef" returntotalrecordcount="true" page="1" count="50" no-lock="false">
  <entity name="allocation">
    <link-entity name="account" from="accountid" to="acl_lender" alias="aa">
      <link-entity name="legalname" from="lenderid" to="accountid" alias="ab">
        <filter type="and">
          <condition attribute="program" operator="not-null" />
        </filter>
      </link-entity>
    </link-entity>
    <attribute name="allocationid" />
    <filter type="and">
      <condition attribute="program" operator="eq" value="{8IJK1790-B7D7-EB11-ABCD-000D3A15EFGH}" />
    </filter>
  </entity>
</fetch>
 
I have the same question (0)
  • Himanshu Kamboj Profile Picture
    425 on at
    I have followed the below sol as well, but unfortunately no luck.
     
     

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans