locked
FetchXML+ subgrid in MSCRM 2013 RRS feed

  • Question

  • Hi,

    I am not able to bind the fetchxml to subgrid during onload in CRM 2013. I want to bind dynamically based on the column value.

    Below are the approaches I tried.

     var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
        "  <entity name='mhi_memberassociatedpcps'>" +
        "    <attribute name='mhi_name' />" +
        "    <attribute name='createdon' />" +
        "    <order attribute='name' descending='false' />" +
        "    <filter type='and'>" +
        "    <condition attribute='mhi_member' operator='eq' value='" + contactId + "' />" +
        "    </filter>" +

        "  </entity>" +
        "</fetch>";

    1.

    Xrm.Page.getControl('MemberAssociatedPCPs')._control.get_innerControl()._element.control.SetParameter("fetchxml",fetchXml);

    2.

    var grid = document.getElementById('MemberAssociatedPCPs');
    //var grid =Xrm.Page.ui.controls.get("MemberAssociatedPCPs");
    if(grid==null || grid.readyState != "complete")
    {
    alert("grid is null");
      setTimeout('disableTab2onLoad()',1000);
    return;
    }

    grid.control.SetParameter("fetchXml", fetchXml);

    grid.control.refresh();

    Could anyone please let me know whether it is possible in CRM 2013.

    Wednesday, October 22, 2014 9:56 PM

Answers

All replies

  • Hi Kalyan,

    Did you select "All Record Types" in the subgrid properties on the form? 



    Vikranth Pandiri Blog: http://howto-mscrm.blogspot.com Twitter: @TweetVikranth "Please Mark it as answer if it helps in resolving your query"

    • Proposed as answer by Nico-TMVP Sunday, October 26, 2014 1:10 PM
    • Marked as answer by Kalyan Sudhir Thursday, October 30, 2014 7:17 PM
    Thursday, October 23, 2014 5:02 AM
  • Hi Kalyan,

    I posted in my Blog. You can check from that url. Crm 2011/2013 Filtering SubGrid


    If you find this post helpful then please Vote as Helpful and Mark As Answer. Thanks and Regards, Polat Aydın http://crmpolataydin.wordpress.com



    Thursday, October 23, 2014 9:17 AM