I wrote some some JavaScript code in CRM 4.0 that triggers when the datagrid inside of an IFrame refreshes. I have upgraded the system to CRM 2011 and changed the IFrame to a SubGrid. Now I am trying to use JavaScript to attach the function to the onrefresh event and can't seem to get it to work.
This is the old code I need to reproduce.
if (crmForm.FormType != 1) {
crmForm.all.IFRAME_OpportunityLines.src = GetFrameSource("fj_opportunity_new_opportunitymanagementmodu");
crmForm.all.IFRAME_OpportunityLines.onreadystatechange = function oppLineTotals() {
if (crmForm.all.IFRAME_OpportunityLines.readyState == 'complete') {
var iFrame = frames[window.event.srcElement.id];
iFrame.document.all.crmGrid.attachEvent("onrefresh", GridRefresh);
}
}
}
Any help would be appreciated.
Thanks