Hide 'New' button available in the related list if SME group is Empty

BKSharma
Giga Contributor

Hi,

I've a requirement as per below screenshot -

  • The 'New' button should be hidden in KB Article tab when SME Group is empty.

  • Users should only be able to submit Knowledge Articles if there is an associated SME Group exist.

BKSharma_0-1754396118595.png

 

 

I see that above 'New" button is the existing UI action button available in kb_knowledge table as below -

BKSharma_1-1754396118522.png

 

Can you please help me to get this done.

 

Thank you.

7 REPLIES 7

Alok Gupta5
Tera Guru
Tera Guru

Hi,

 

In this you have gliderecord the group member table and check if user is part of that, if yes then show the button otherwise hide it.

 

Regards,
Alok Gupta

Ankur Bawiskar
Tera Patron
Tera Patron

@BKSharma 

you can configure list control in that related list and use "Omit new condition" script field to hide New button

AnkurBawiskar_0-1754400100561.png

 

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

Hi @Ankur Bawiskar , can't I add just a condition '&& u_sme_group!=NULL' in the existing UI Action button like below -

 

BKSharma_0-1754456586554.png

 

The requirement is on 'u_it_service_offering' table, and KB article tab is available on the bottom of the page which links to knowledge table. And by default that 'New' button is coming. But as per the requirement, that 'New' button should be hidden if 'SME Group' field is empty. If not that should be visible on that page. 

@BKSharma 

since this functionality should happen only on Related list and that too based on the Group present or not on the main form, it won't work directly by updating the NEW button on knowledge, as it won't have access to the SME group field which is on other table.

So you cannot do this with the OOTB new button on knowledge table

When you use Configure -> List control you have access to the parent/main form and can get the field values

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