UI Action visibility based on form changes without DOM manipulation?

Stefan Reichelt
Tera Guru
Tera Guru

Hi all,

Does anyone know how to hide a UI Action based on form values without doing any DOM manipulation stuff? The UI Action Conditions alone don't help, as they are not evaluated on form changes.

 

I've got a concrete example: In the Catalog Task, there is the OOB "Close Task" button which is really not helpful if you want to close the task as "Closed Incomplete". When you click it after changing the field value, it immediately closes the task as "Closed Complete". So I can either change the code of the UI Action to keep the state in such a case, or I find a way to hide the button if the user changes the state to "Closed Incomplete". on the form.

 

So if I want to try the second option, can I do it without touching the DOM (something that Instance Scan would definitely complain about for good reasons)?

 

Best regards

(PS: Not sure why this post ended up in this forum, but I hope it can get answered anyway)

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Stefan Reichelt 

you will have to use DOM manipulation with 2nd option. no other way

Another way is to have your own custom UI action to mark task as "Closed Incomplete" and let user chose which button they want to click.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Stefan Reichelt 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Gloria Benny
Tera Contributor

Creating an alternate UI Action would be a better approach instead of trying to use the same UI Action to Close Cancel/incomplete