Question on incident

suru2
Tera Contributor

Hello 
I have one requirement on incident, When caller is VIP then only impact choice "vip user" should be visible otherwise aren't visible for  non vip user.
Could you please help on this to get the proper solution.

Thanks

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@suru2 Please create an onChange Client script on the incident table as follows.

 

Screenshot 2024-03-08 at 11.17.15 AM.png

Here is the script.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    var caller = g_form.getReference('caller_id', callerCallback);

    function callerCallback(caller) {
        if (caller.vip) {
            g_form.clearOptions('impact');
            g_form.addOption('impact', 'vip_user', 'VIP User');
        }
    }

}

GV Saranesh Kum
Kilo Guru

@suru2 Agree with @Sandeep Rajput response.

Just an add,

If your requirement is to have only one Value available in impact field then i would recommend to auto populate it and make it read only.

If your requirment is to have the choice 'VIP User' visible along with other choice values for Impact field, then use the g_form.addOption method. (g_form.clearOptions is not required)

 

Hope this info helps.