UI Action (button) for specific SYS ID

AdamUMC
Tera Guru

Hi,

I have a "sys_template" (Incident template) for which I have made a new button.
It's actually the same button as hidden behind the hamburger- icon ("Insert and Stay").

Now I want this button to be available for only this specific template. I have tried several conditions within the button's UI Action, but nothing seems to work. How can I solve this problem?

I have tried:
- Condition = sys_id=a0a80ee597676110b4fbb1e3f245986f^EQ (does not work)

- Condition= template=[[OB]] -^EQ (does not work)

- Condition = name=[[OB]] - ^EQ (does not work)

Thanks in advance!

1 ACCEPTED SOLUTION

@AdamUMC  
current.getUniqueValue() == 'ur_template_sys_id'.So the Ui Action would only show on that particular template.
If my response helped please mark it correct and close the thread

View solution in original post

26 REPLIES 26

You should try this in new client script instead of editing in same.

I solved the problem.
My template is located within the "sys_template" table, but there are a few "Save" buttons, a few (2) at the "sys_template" table, but also a few on another few tables.

I tested all UI Actions with the name "Save" that are available within the UI Action of this template (sys_template) and guess what? The UI Actiuon "Save" within table "sys_metadata" is the UI Action that is serving the "Save" button at the template. By disabling this UI Action, the button dissapears.

After extending the condition with && current.getUniqueValue() != 'a0a80ee597676110b4fbb1e3f245986f'

And enabling this UI Action, the problem was finally solved. The final condition is:

!(current.isNewRecord() && !current.canCreate()) && current.canWrite() && current.getUniqueValue() != 'a0a80ee597676110b4fbb1e3f245986f'

Hi AdamUMC

 

Can you mark my solution as Accept, As it will help other users to get better understanding with same scenerio.

 

Regards,

Samaksh

Samaksh Wani
Giga Sage
Giga Sage

Hi Adam,

 

Plz Write.  current.template == 'sys_id'. 

this in condition field of UI Action.

 

Mark my solution as Accepted, if you find it helpful.

 

Regards 

Samaksh

Hi Samaksh,

Sadly this one does not work (now tested).

current.template == 'a0a80ee597676110b4fbb1e3f245986f' results in button dissapears when the sys_template with this sys_id is opened. If I open another template, the button is also not shown.