Hi I am trying to make a record read only in some specific condition.
I am able to make all fields read only but unable to do the same for grid Views in that form
Here is my code
function makingAllFieldreadOnly() {
debugger;
var statusValue = Xrm.Page.getAttribute("statuscode").getValue();
if (statusValue == 4) {
var controls = Xrm.Page.ui.controls.get();
for (var i in controls) {
var control = controls[i];
if (i == 10 || i == 11 || i == 12 || i == 21 || i == 22 || i == 26) {//To avoid GridView
}
else {
try {
if (control) {
control.setDisabled(true);
}
}
catch (e) {
alert(e.message + "");
}
}
}
}
else {
var controls = Xrm.Page.ui.controls.get();
for (var i in controls) {
var control = controls[i];
if (i == 10 || i == 11 || i == 12 || i == 21 || i == 22 || i == 26) {//To avoid GridView
}
else {
try {
if (control) {
control.setDisabled(false);
}
}
catch (e) {
alert(e.message + "");
}
}
}
}
}
Is there any supported way to amke grid view also read only..(Please Note:-I dont want to use RBW)
*This post is locked for comments