Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

How to make all fields read only on a form like hyperlink and a simple field.

$
0
0

Hello,

I am trying to make all fields on form as a read only when the status get change

I want to make the the fields and the hyperlink fields read only

fields like 

and hyperlink like

I want both of this get read only that the user can not change the any record on this,

specially for the hyperlink type field .

This type of fields click opens the different forms ,that i want to make read only.

I make the fields read only using this java script  on the form onload

 function ReadOnly() {

//alert("hii");

var status = Xrm.Page.getAttribute("statuscode").getText();

alert(status);
if (Xrm.Page.getAttribute("statuscode").getText() != "Draft") {
//alert("hello");
Xrm.Page.data.entity.attributes.forEach(function (attribute, index) {
var control = Xrm.Page.getControl(attribute.getName());
if (control) {
control.setDisabled(true)
}
});
}
}

But i didn't get the solution to make read only hyperlink type fields.

please  help me to resolve this problem.

Thank you in advance.


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>