Hide UI Action on form

Dariussiriuse
Tera Contributor

Hi!

So, I am having this situation where I want to hide the OOTB UI Action buttons from a form that belongs to the Global Scope, but I want this to happen on the scoped application.

 

When I have done ' hide('button_name'); ', it somehow just deactivated it for all forms on my instance.

Sure enough I reactivated it manually, but what if this happens on a future client's instance?

 

Also, this works, but only at the top of the form, the bottom remains visible.

 

Any ideas why?

 

Thanks,

Darius

9 REPLIES 9

I'm afraid I cannot do this in the current setup I have, because I am developing my application with its own scoped name, the UI Action in question (submit) is on the Global.

 

Although I'm not certain what you suggest me to add this for, are you suggesting to do this on the Global scope? Because if so, the configuration won't be saved on the app.

 

Thanks,

Darius

Ankur Bawiskar
Tera Patron
Tera Patron

@Dariussiriuse 

are you not hiding it based on UI action condition?

how are you currently achieving this?

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

Well, if I change the condition on the button, it will affect other forms as well as it is the OOTB, so from this point of view, I don't want to put a condition on the UI Action.

 

So, worst case scenario, I could do this on UI Action condition, that is fine. But I am developing my own application with its own scope, and the button is on global. So, either ways I can't edit it from my own scope as the button is on Global. I ended up making this from client script. 

 

Interestingly enough, this works just fine now. But my worry is that I don't understand WHY it deactivated it when I first entered this code? All I had was hide('button_name'); and it was gone (which is what I wanted) on my form. But soon I realised that it was gone on pretty much every other form too (incidents, change, etc). So having investigated the issue, I realised that it was deactivated. That's why I am asking the question! Why could it be deactivated? What could have triggered this, especially since I'm giving directives from a scoped application.

 

So naturally I cannot do anything else but worry about anyone else having the application and experiencing the same issue.

 

Thanks,

Darius

 

@Dariussiriuse 

then use onLoad client script on your table and hide the UI actions using DOM manipulation

Remember DOM manipulation is not recommended.

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

To which extent this is acceptable?

I mean when should I avoid this at all cost?