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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2016 subgrid layoutxml not working

(0) ShareShare
ReportReport
Posted on by 241

I am adding a subgrid to the form and using javascript to set fetchxml and layoutxml for it. The filter works but the layout doesn't. It always shows the layout of the default view I picked through the form editor.  Here is part of my code. Please help:

var ConnectionSubgrid = document.getElementById("RelatedSeats");
if (ConnectionSubgrid == null) {
setTimeout(function () { FilterConnectionSubgrid(); }, 2000); //if the grid hasn’t loaded run this again
return;
}

var AdmissionSeatFetchXML = '<fetch mapping="logical" count="50" version="1.0"><entity name="ttc_admissionseat"><attribute name="ttc_admissionseatid" /><attribute name="ttc_admissionseatstatus" /><attribute name="ttc_admissionsectionid" /><attribute name="ttc_admissionstatusdate" /> <attribute name="ttc_applicationid" /><attribute name="ttc_candidateid" /><attribute name="ttc_contactid" /><attribute name="ttc_continuingenrollmentid" /><attribute name="ttc_datatelsectionid" /><attribute name="ttc_datatelstatus" /><attribute name="ttc_datatelstatusdate" /><attribute name="ttc_registrarseatstatus" /> <attribute name="ttc_registrarseatstatusdate" /><attribute name="ttc_name" /><filter><condition attribute="statecode" operator="eq" value="0" /><condition attribute="ttc_applicationid" operator="eq" value="' + applicationid + '" /></filter></entity></fetch>';
ConnectionSubgrid.control.SetParameter("fetchXml", AdmissionSeatFetchXML);


var AdmissionSeatLayoutXML = '<grid name="resultset" object="10136" jump="ttc_name" select="1" icon="1" preview="1"> <row name="result" id="ttc_admissionseatid"> <cell name="ttc_admissionsectionid" width="280"/><cell name="ttc_admissionseatstatus" width="120"/> </row></grid>';
ConnectionSubgrid.control.SetParameter("layoutXml", AdmissionSeatLayoutXML);


ConnectionSubgrid.control.Refresh();
Xrm.Page.ui.controls.get("RelatedSeats").refresh();

Thanks.

Holly

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hello Holly ,

    This is  not a supported approach ,I would recommend create an custom html web resource  and display the data in a  custom grid. There are many free third party grid available like JQuery easy UI , kendo UI . You can  use any of them and  fetch the record to bind the grid .

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi Holly,

    using the setParameter with fetchXml and layoutXml used to work with Dynamics CRM 2015 and above, but Microsoft changed some of the code in 2015 SP1, and this stopped working and/or being supported.

    You will need to find another approach.

    Hope this helps.

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Aric is correct , as Microsoft introduce turbo form in Dynamics CRM 2015 for faster form rendering and its not supported anymore . So better to develop custom web resource for this type of changes .

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans