knowledge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
how to hide translate ui action on a knowledge form for few knowledge bases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
41m ago
So on my PDI I have OOTB UI action on KB article form shown below:
Upon checking this UI action definition I can see condition to show this UI action on few KBs, so you can leverage the same approach for your use case.
In the Translate UI action, just update the Condition field to check against the Knowledge Base sys_ids. For example:
!gs.nil(current.kb_knowledge_base) &&
['429b07aaXXXXXXX', '91a8f1aXXXXXXXc7e9']
.indexOf(current.kb_knowledge_base.toString()) == -1 &&
current.workflow_state == 'published'
This way, the Translate button will only show when the KB article is published and the KB is not in the restricted list.
That keeps everything server-side in the condition itself and avoids needing extra client scripts.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
33m ago - last edited 20m ago
Hi @Bhavani1995,
Is this the UI action you were talking about?
I searched and got this one: Translate_Knowledge_Full_Category_String.
Update your instance url, then you can access this UI action. If this is the same UI action you're talking about then you can follow the given solution.
So to hide this UI Action for specific Knowledge Bases, you should modify its condition. In the Condition field, you need to add a check to exclude the specific knowledge bases. The best way to do this is to check if the current record's knowledge base sys_id is not in a list of the KBs where you want to hide the button. For example, you would add
&& ['sys_id_of_kb1', 'sys_id_of_kb2'].indexOf(current.kb_knowledge_base.sys_id.toString()) == -1
to the end of the existing condition. This is the standard method for conditionally controlling the visibility of a UI Action without altering its core script.
Hope this helps!
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution and helpful so others can benefit as well.