Hi everyone!
I want to filter a View that i add to Service Activity form based on the Scheduled Start date.
I use the following code:
function filterView() {
var gridHtml = document.getElementById('clinicCalendarSubGrid');
alert(gridHtml);
var startDate = Xrm.Page.getAttribute("scheduledstart").getValue();
if (!gridHtml)
return;
var fetchXml = [
'<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">',
'<entity name="ral_site">',
'<attribute name="ral_date"/>',
'<attribute name="ral_name"/>',
'<attribute name="ral_resources"/>',
'<order descending="false" attribute= "ral_date"/>',
'<filter type="and">',
'<condition attribute="ral_date" operator= "eq" value= '" + startDate + "'/>',
'</filter>',
'</entity>',
'</fetch>'
].join("\n");
var gridHtml = document.getElementById('clinicCalendarSubGrid');
gridHtml.control.SetParameter("fetchXml", fetchXml);
gridHtml.control.refresh();
}
I get an error instantly but the error is not informative, all i get is undefined. Anyone know what is wrong with my code and how to fix it?
Thanks a lot!
*This post is locked for comments
I have the same question (0)