How to make OOB visible if condition is met
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2023 07:51 AM
Hi,
Im trying to make fields read only if condition is met, some of the fields that are not OOB become read only but the OOB fields dont become read only (like category,caller_id etc):
function onLoad() {
//Type appropriate comment here, and begin script below
var us = g_user.userID;
if (us != g_form.getValue('assigned_to')) {
for (var x = 0; x < g_form.elements.length; x++) {
g_form.setReadOnly(g_form.elements[x].fieldName, true);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2023 01:14 PM
I'm assuming this is related to this question: Write ACL on the task table
You should continue with the Access Control method because this Client Script would NOT protect you record in a List view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2023 01:49 PM
BUT, to answer the question, yes, UI Policies are overriding the Client Scripts because they run after the onLoad Client Scripts.