locked
Enable/Disable field in CRM 2011 using condition RRS feed

  • Question

  • Hi all,

    could you help me, currently i working on an entity form...like this

    Chiller available : yes   ||  no   <-- visible (default no)
    Cold              : yes   ||  no   <-- disable
    Lightning         : yes   ||  no   <-- disable

    what i want is, when i check the chiller available into yes, the cold and lightning field enable (visible)

    i have write a script like this :

    var FORM_TYPE_CREATE = 1;   
    var formType = Mobile.Page.ui.getFormType();  
    var cekData = "";
    var cekDataSave = "";
    
    function setDisabledForm()
    {
          var controls = Mobile.Page.ui.controls.get();
          var cekcontrols = Mobile.Page.ui.controls.get('ttr_chilleravailable');
          for (var i in controls) {
               var control = controls[i];
               if(Mobile.Page.getAttribute('ttr_chilleravailable').getValue() == true)
               {
                     control.setVisible(true);
               }
               else
               {
                     control.setDisabled(true);
               }             
          }
          cekcontrols.setDisabled(false); 
          return false;     
    }

    but when i execute this script, although i check the chiller available into yes, nothing happen, the other field doesnt visible.

    could someone help me correct my script?

    thank you

    Tuesday, September 22, 2015 11:24 AM

All replies

  • Hi,

    I think "Mobile.Page.getAttribute('ttr_chilleravailable').getValue()" will return a number. You can compare this with a numeric value (e.g. 1).

    • Proposed as answer by P H S Monday, September 28, 2015 12:39 PM
    Monday, September 28, 2015 12:39 PM