Want to hide one option and only specific users can see it.

zaxjun
Tera Contributor

Hello Everyone,

 

Good day!

 

I would like to ask for your help on how to hide/show one of the option in status for specific users.

 

I'd like to hide the status "Pending Root Cause Analysis" from any users and can only be seen by incident managers.

 

This form is for the incident ticket.

 

Thank you in advance!

1 ACCEPTED SOLUTION

SANDEEP28
Mega Sage

@zaxjun Create onLoad client script on incident table as below

 

SANDEEP28_0-1696764551547.png

 

In below script you need to replace choice value of "Pending Root Cause Analysis" status option in second parameter of removeOption() method

 

function onLoad() {

    if (!g_user.hasRole('incident_manager')) {
        g_form.removeOption('state', '9');
    }
}

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

View solution in original post

3 REPLIES 3

SANDEEP28
Mega Sage

@zaxjun Create onLoad client script on incident table as below

 

SANDEEP28_0-1696764551547.png

 

In below script you need to replace choice value of "Pending Root Cause Analysis" status option in second parameter of removeOption() method

 

function onLoad() {

    if (!g_user.hasRole('incident_manager')) {
        g_form.removeOption('state', '9');
    }
}

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

zaxjun
Tera Contributor

Thank you Sandeep.

SANDEEP28
Mega Sage

@zaxjun If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!