- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 07:09 PM
Hello.
Implemented a script to deactivate a screen field in case of certain status in UI policy.
I have a field in my script that I don't want to deactivate, but I'm using exception handling,
but the reference field button doesn't work.
What is the cause?
<UI policy>
<UI policy Script>
function onCondition() {
//必要に応じて条件を挿入
var notReadOnly = ["u_choice_3","u_shounin_user_id","u_shounin_pw","u_sekininsha_user_id","u_sekininsha_pw","request"];
var fields = g_form.getEditableFields(); //フォームの編集可能フィールを取得
for (var x = 0; x < fields.length; x++) {
if(notReadOnly.indexOf(fields[x]) == -1){
g_form.setMandatory(fields[x], false); //必須を無効にする
g_form.setReadOnly(fields[x], true); //読取り専用にする
}
}
g_form.setReadOnly("variables."+ req_category_1, true);
g_form.setReadOnly("variables."+ req_category_2, true);
g_form.setReadOnly("variables."+ req_category_3, true);
g_form.setReadOnly("variables."+ req_category_4, true);
g_form.setReadOnly("variables."+ req_category_5, true);
g_form.setReadOnly("variables."+ req_device_1, true);
g_form.setReadOnly("variables."+ req_device_2, true);
}
<problem screen>
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 08:16 PM
Hi,
Please check the community article below.
https://community.servicenow.com/community?id=community_question&sys_id=d570c3e1db98dbc01dcaf3231f96192e
You can enable it by setting property "glide.ui.reference.readonly.clickthrough" to true.
Thanks,
Arav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 07:31 PM
Hi,
As per my understanding, preview button might be disabled due to some other issue like UI action scripts.
Try to disable your UI policy and try to click on it.
Feel free to mark helpful & correct!
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 07:35 PM
Thank you.
After disabling the UI policy, you can press the browse button.
Is there a way to make it possible to press the browse button while keeping the UI policy enabled?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 08:16 PM
Hi,
Please check the community article below.
https://community.servicenow.com/community?id=community_question&sys_id=d570c3e1db98dbc01dcaf3231f96192e
You can enable it by setting property "glide.ui.reference.readonly.clickthrough" to true.
Thanks,
Arav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:14 PM
Thank you.
I did the following based on the article, but there was no change in the situation.
Is it because I'm using UI action scripts?
①
setting property "glide.ui.reference.readonly.clickthrough" to true.
②
Add this in attributes field of the dictionary index, if want to make it clickable:
readonly_clickthrough=true