Tuesday, August 13, 2013

CRM 2011/2013 Custom Validation tool is not loading web resources.

CRM 2011/2013 Custom Validation tool is not loading web resources if the content of any of the web resource is blank. Thanks Linna to find  the issue.



Cheers..

Update FetchXML and Refresh sub grid in supported way on rollup 12 and later

Below function can be used to change the fetch XML and refresh the Grid control. This is 100% tested and working without an issue with even latest UR 14 on IE, Chrome and Firefox. I haven't access the DOM directly here since it is not supported.

function PopulateGridFetchXML(sourceFunctionName, subGridName, fetchXML) {
    var subGrid = Xrm.Page.getControl(subGridName);
    if (subGrid._control.get_innerControl() == null) {
            setTimeout(sourceFunctionName, 1000);
            return;
    }
    subGrid._control.get_innerControl().SetParameter("fetchXml", fetchXML);
    // Refresh the grid
    subGrid.refresh();
}

Cheers,