I want to create a UI action DELETE for change task

ARNAB3
Giga Expert

I want to create  a UI action which  will  appear only on change_task . 

Name of the button DELETE change task

It will appear  for the  change_manager  role and  if Task  corelation_id  = = blank 

How t do this ? 

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee
7 REPLIES 7

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

follow these threads:

https://community.servicenow.com/community?id=community_question&sys_id=842278c8dbf6f740feb1a851ca96...

https://community.servicenow.com/community?id=community_question&sys_id=7fc6f5dddb6a1740f7fca851ca96...

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

asifnoor
Kilo Patron

Go to UI actions

Create a UI action named Delete

select table change_task

under conditions mention

//check field names

gs.getUser().hasRole("change_manager") && current.task_correlation_id==''

Under Script you can add code to delete after confirmation. You can check out any available OOB ui action delete and replicate the same functionality in your custom ui action.

Yash Agrawal1
Tera Guru

Hello,

Please create UI action like the Below image.Dont forget to click on "Form  Button" checkbox.

find_real_file.png

If want ore help in coding. Please keep posted.

 

Please Mark it helpful/correct if my answer helps in any way to resolve your query.
Reach out to me if any more help required.

Regards

Yash.K.Agrawal

Ankur Bawiskar
Tera Patron
Tera Patron

@ARNAB 

Please follow this steps

1) go to this OOB Delete UI Action

URL: https://instanceName.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=1f12506f7f532200348ef0d8adfa9139

2) change the table name from global to change_task

3) in condition add this part along with existing condition

gs.hasRole('change_manager') && current.task_correlation_id == ''

4) Perform Insert and Stay

This will override the UI action and create new one for your table

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader