locked
make form readonly(disabled) RRS feed

  • Question

  • Using javascript disable the form(all the elements in the form readonly) on change of a field value.

    Thanks

    Wednesday, December 24, 2014 6:47 AM

Answers

  • Please call below function on the change of field :

    function formdisable(disablestatus)
    
    {
    
        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();          
    
               Xrm.Page.getControl(myname).setDisabled(disablestatus); 
    
        }
    
    } 
    More ref : link link


    Regards, Saad

    • Proposed as answer by HIMBAPModerator Wednesday, December 24, 2014 6:59 AM
    • Marked as answer by Amy.4 Wednesday, December 24, 2014 10:05 AM
    Wednesday, December 24, 2014 6:57 AM