Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Fetch xml through subgrid binding

$
0
0

Hi

I have written the Fecth xml for binding the subgrid

1.Product entity have field abc_minentryage

2.Contact entity have filed like abc_agelastbirthday'

i have to compare the product entity age with contact enity age nd fill into the subgrid of contact entiy page

pls check below code it's not working can you  pls suggest it

function updateSubGrid()
{
    var relatedProducts = document.getElementById("crosssellproducts");
    var contactage = Xrm.Page.data.entity.attributes.get('abc_agelastbirthday').getValue();
       if (relatedProducts == null || relatedProducts.readyState != "complete")
           {
              setTimeout('updateSubGrid()', 1000);
              return;
           }

    //This is the fetch xml code which will retrieve all the order products related to the order selected for the case.

    var fetchXml;
    fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>";
    fetchXml += "<entity name='Product'>";
    fetchXml += "<attribute name='name' />"; 
    fetchXml += "<attribute name='Productnumber' />";
    fetchXml += "<attribute name='abc_investmenttypes' />";
    fetchXml += "<attribute name='abc_plantype' />";
   fetchXml += "<filter type='and'>";
    fetchXml += "<condition attribute='abc_minentryage' operator='eq'  value= '" + contactage + "' />";
    fetchXml += "</filter>";
     fetchXml += "</entity>";
    fetchXml += "</fetch>";

    relatedProducts.control.setParameter("fetchXml", fetchXml);

    //relatedProducts.control.refresh();

}


Rammohan


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>