How to make OOB visible if condition is met

Alon Grod
Tera Expert

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);
        }

    }

}

 

6 REPLIES 6

Jim Coyne
Kilo Patron

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.

BUT, to answer the question, yes, UI Policies are overriding the Client Scripts because they run after the onLoad Client Scripts.