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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2018 08:27 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2018 09:27 PM
hi sureshdasari,
Can You share your client Script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2018 10:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2018 10:59 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2018 11:19 PM
Hi Karishma,
I have tried this way as well. even i tried to use setdisabled, still no luck.