Overriding UI Action on a global table in scoped application - will it affect that table globally?

c5ho
Tera Contributor

Hi Experts,

 

I'm creating Catalog Tasks in the sc_task table as part of a request process in a scoped application.  I want to remove the 'Close Task' and 'Cancel Task' buttons for most users other than a designated role which has the ability to Close the task.

 

I know that I can override the OOB UI Action by copy and creating a new one with my specific conditions as per:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0692665

 

However, this requires changing the condition of the Global UI Action. 

 

Will doing this override affect the sc_task table globally for all applications using it?

 

Thanks in advance.

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@c5ho You can override the actions in your Scoped application and in order to hide the Global UI Action you can put a check of application in condition field of the Global UI Action (check application name using

gs.getCurrentScopeName(). Hide the Global UI Action if the user is using your Scoped application.

)

c5ho
Tera Contributor

Hi @Sandeep Rajput 

 

Thanks for your response.  I'm providing a bit more context here for clarity:

As the UI Action in question affects the sc_task global table, there is currently a global UI action called "Close Task" which is for the "Close Task" form button in the Catalog Task form.

 

In my scoped application, Catalog Tasks are created when a request is approved.  I want to only show the "Close Task" and "Cancel Task" buttons for a specific user group.

 

If I understand you correctly, I need to do this:

 

1. In the current Global 'Close Task' UI Action, add this to the condition: && gs.getCurrentScopeName() != ('MyScopeName')


2. Add a second Global 'Close Task' UI Action with the condition: && gs.getCurrentScopeName() == ('MyScopeName') && gs.getUser().isMemberOf('Privileged Group')

 

Is that correct?  My first condition of gs.getCurrentScopeName() == ('MyScopeName') seems redundant.

 

Thanks in advance.

@c5ho Yes, you understood it correctly.

 

You should use gs.getCurrentScopeName() == ('MyScopeName') in the second UI action as if the condition is not there then users from the Privileged Group might see the same UI Action outside your application scope.