ERROR in filter subgrid of ms crm 2013 RRS feed

  • Question

  • getting an error in filter subgrid Ms crm 2013 that is on the line of

     CasesSubgrid.control.SetParameter("FetchXml", fetchXml); 

    i tried with setParameter also

    if you any idea please suggest me...

    ms crm

    Friday, January 31, 2014 7:13 PM

All replies

  • Hi,

        Can you please post the error and the code snippet? The syntax of this given line seems right. Might be the fetchXML query is not formatted properly. Something worth checking.

    Hope this helps.
     Minal Dahiya
    blog : http://minaldahiya.blogspot.com.au/

    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Saturday, February 1, 2014 10:18 AM
  • thanks for the Reply Minal the prob has been solved here is the code..

    function FilterCasesSubgrid() {
       var CasesSubgrid =Xrm.Page.getControl('RecentCases');

            setTimeout(function () { FilterCasesSubgrid(); }, 2000); //if the grid hasn’t loaded run this again when it has 
        var contactValue = Xrm.Page.getAttribute("customerid").getValue(); //field to filter by 
       // var contactId = "00000000-0000-0000-0000-000000000000"; //if filter field is null display nothing 
        if (contactValue != null) {
            var contactId = contactValue[0].id;
        //fetch xml code which will retrieve all the accounts related to the contact 
        var fetchXml ="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
      "<entity name='incident'>"+
        "<attribute name='title' />"+
        "<attribute name='ticketnumber' />"+
        "<attribute name='createdon' />"+
        "<attribute name='incidentid' />"+
        "<order attribute='title' descending='false' />"+
        "<filter type='and'>"+
          "<condition attribute='customerid' operator='eq' uitype='contact' value='"+contactId+"' />"+
    //Here i set the fetchxml directly to subgrid
        RecentCases.control.SetParameter("fetchXml", fetchXml); //set the fetch xml to the sub grid  
        RecentCases.control.Refresh(); //refresh the sub grid using the new fetch xml 


    ms crm

    • Edited by Reddy A Monday, February 3, 2014 6:19 AM
    Monday, February 3, 2014 6:18 AM