- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 04:27 PM
Is it possible to add a new button for example Create HR Case to the knowledge view? The functionality will be similar to Create Incident. Thanks in advance for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 05:47 PM
These button are contained inside the "kb_view_common_header_toolbar" UI Macro.
These are not UI Action so you will have to modify the jelly script to add your required buttons and make them do what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 09:37 AM
Thank Laurent. Have you added any custom button on the knowledge article view? I'd like to see how you did it if you have added it before. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 10:07 AM
We added a Print button so unlike yours, it had only client side implication, it was a simple javascript onclick to open a pop-up with the article without the SNOW frame and passing a parameter that calls window.print(). We replicated the behavior of the printer friendly version button that you find in the user preference menu.
Here is what we added following the Edit button
<j:if test="${showUpdateAction}">
<button id="editArticle" title="${gs.getMessage('Edit content')}" class="btn btn-default navbar-btn snc-article-header-toolbar-button">${gs.getMessage("Edit")}</button>
</j:if>
<!-- Custom added to add a print Button when there is the required sysparm -->
<g:evaluate var="sysparm_media">
var sysparm_media = RP.getParameterValue("sysparm_media");
sysparm_media;
</g:evaluate>
<j:if test="${sysparm_media!='print'}">
<button id="printArticle" title="${gs.getMessage('Print Article')}" class="btn navbar-btn btn-primary" style="display:inline-block;" onclick="window.open('/kb_view.do?sys_kb_id=${knowledgeRecord.sys_id}&sysparm_media=print', 'Printer_friendly_format', 'resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no')">${gs.getMessage("Print")}</button>
</j:if>
<!-- Automatically opens the print option of the browser when the sysparm get passed using the previous button -->
<j:if test="${sysparm_media=='print'}">
<script>
window.print();
</script>
</j:if>
However you are saying that you want to do a similar button the the createIncident button which looks like:
<button id="createIncident" title="${gs.getMessage('Create Incident')}" class="btn btn-default navbar-btn snc-article-header-toolbar-button">${gs.getMessage("Create Incident")}</button>
I'm not aware of what handle the click of this button, but you could probably mimic the create incident with a href="your_table.do?sys_id=-1&sysparm_query=field_x=value_you_want_in_that_field"
If you want to share your requirement, I could try to help you with a better example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 10:20 AM
Thank you very much for sharing that. Our requirement was to add a new button called "Create HR Case" that would open a new HR case form and pre-populate the information similar to the "Create Incident" button does. I'm not familiar with Jelly so it's been a challenge for me. I'm trying to find the function that handle the click of incident so I can replicate it but no luck.