Create a UI policy to show a field or message for priority users

DevtoSME
Giga Guru

I created a custom field for users to be identified by their priority.(see attachment below)

 

I need to create a label that will show when a user has the priority option selected on their user profile under the caller field of a incident/request/change form that says elite 

a solution i got was to  create a client script that triggers on load/on change for Caller. The client script would need to call a script include to check the "sys_user" table and check the value of "service offering" then based on the result you can display a field message via the same client script.

is there anyone that can help wit how to do this?

1 ACCEPTED SOLUTION

SAI VENKATESH
Tera Sage
Tera Sage

Hi @DevtoSME 

You can try the below script (make sure change the script based upon your requirement)

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var callername = g_form.getReference('caller_id', callback);

    function callback(callername) {
        var departname = callername.vip
        alert(departname);
        if (service_offering=="priority') {// make sure back end names are correct
            g_form.setVisible("your_field_name",true);
        }
    }
}

 

Thanks and Regards

Sai venkatesh

View solution in original post

1 REPLY 1

SAI VENKATESH
Tera Sage
Tera Sage

Hi @DevtoSME 

You can try the below script (make sure change the script based upon your requirement)

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var callername = g_form.getReference('caller_id', callback);

    function callback(callername) {
        var departname = callername.vip
        alert(departname);
        if (service_offering=="priority') {// make sure back end names are correct
            g_form.setVisible("your_field_name",true);
        }
    }
}

 

Thanks and Regards

Sai venkatesh