g_form.setReadOnly('variable',true); not working in RITM level using on load Client script

Suresh1
Tera Guru

Hi Team,

 

I am using an On Load Client script to set a variable ReadOnly. The field is in the variables section, and it's not setting to readonly.

its silly but could n't figure out what is the issue... I have checked the UI policies, other client scripts and there is no collision happening.

 

Please let me know what could be the issue.

 

Regards,
Suresh

10 REPLIES 10

Karishma5
Tera Expert

hi sureshdasari,

Can You share your client Script?

 

Hi Karishma,

 

Below is the On-Load Client script am using.

 

I used DOM as well, no luck.

 

 

hi suresh,

Try accessing variables as follows in your client script,

if(g_scratchpad.fieldeditable==true){

g_form.setReadOnly('variables.service_da_required',false);

}

else{

g_form.setReadOnly('variables.service_da_required',true);

}

 

Hope it works.

Hi Karishma,

 

I have tried this way as well. even i tried to use setdisabled, still no luck.