below peice of code to refresh the subgrid.
function SubGridLoadWait() {
setTimeout(OnAccountFormLoad, 3000);
}
function OnAccountFormLoad() {
//Set Action on subgrid Refresh
//debugger;
var subGrid = document.getElementById(" SuspectGrid");
//if(subGrid) {
subGrid.attachEvent(" onrefresh", getPrimaryRows);
//SubGrid.attachEvent(" onrefresh", CallbackFunction);
//SubGrid.control.add_ onRefresh(CallbackFunction);
//}
}
//This function fires on subgrid refresh
function getPrimaryRows() {
var isPrimaryYes = false;
var isPrimaryNo = false;
var gridControl = document.getElementById(' SuspectGrid').control;
var ids = gridControl.get_allRecordIds() ;
for (i = 0; i < ids.length; i++) {
var primary = gridControl.getCellValue('new_ isprimarysuspect', ids[i]);
if (primary=="Yes") {
isPrimaryYes = true;
break;
}
else if(primary=="No"){
isPrimaryNo = true;
}
}
if (isPrimaryYes) {
Xrm.Page.getAttribute("new_ canhaveprimarysuspect"). setValue(true);
// alert("Primary Suspect checked");
}
else if (isPrimaryNo) {
Xrm.Page.getAttribute("new_ canhaveprimarysuspect"). setValue(false);
// alert("Primary Suspect unchecked");
}
}
setTimeout(OnAccountFormLoad, 3000);
}
function OnAccountFormLoad() {
//Set Action on subgrid Refresh
//debugger;
var subGrid = document.getElementById("
//if(subGrid) {
subGrid.attachEvent("
//SubGrid.attachEvent("
//SubGrid.control.add_
//}
}
//This function fires on subgrid refresh
function getPrimaryRows() {
var isPrimaryYes = false;
var isPrimaryNo = false;
var gridControl = document.getElementById('
var ids = gridControl.get_allRecordIds()
for (i = 0; i < ids.length; i++) {
var primary = gridControl.getCellValue('new_
if (primary=="Yes") {
isPrimaryYes = true;
break;
}
else if(primary=="No"){
isPrimaryNo = true;
}
}
if (isPrimaryYes) {
Xrm.Page.getAttribute("new_
// alert("Primary Suspect checked");
}
else if (isPrimaryNo) {
Xrm.Page.getAttribute("new_
// alert("Primary Suspect unchecked");
}
}
No comments:
Post a Comment