function formdisable() {
    var skipFields = ",new_fieldtoskip1name,new_fieldtoskip2name,";
  
    var allAttributes = Xrm.Page.data.entity.attributes.get();
    for (var i in allAttributes) {
        var myattribute = Xrm.Page.data.entity.attributes.get(allAttributes[i].getName());
        var myname = myattribute.getName();
        if (skipFields.indexOf("," + myname + ",") != -1) {
            continue;
        }
        try {
            Xrm.Page.getControl(myname).setDisabled(true);
        } catch (err) {}
    }
}
Interesting, thanks Arturo. I might make a slight modification where I pass it in as a parameter.
ReplyDeleteDave J
Sure Dave!, feel free to modify it as you need it.
ReplyDeletePlease contact me at jlmullikin@emesec.net. I have been trying to contact you from upwork and LinkedIn. I have a great contracting opportunity for you with my company
ReplyDelete