- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 12:15 AM
Hi All,
We have a requirement to create a button on the catalog item that will only be visible when the user opens in service portal.I tried as per below step but I observed instead of service portal, its appearing at the RITM level. Could you please let me know how to implement a custom button on catalog item only?
steps i followed:
1. Created a UI Macro under System UI.
//XML Code
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div>
<button type="button" class="btn btn-default btn-block" onclick="alert('Hello world!')">Next</button>
</div>
</j:jelly>
2. Created a Widget under Service Portal
//HTML Code
<div>
<!-- your widget template -->
<button type="button" class="btn btn-default btn-block" onclick="alert('Hello world!')">Next</button>
</div>
*For now I have not added any functionality under Client cOntroller and Server script
3. Created a variable in the catalog item of Macro type and mapped this UI macro and WIdget I created.
Instead of appearing at the Catalog Item, its appearing under RITM level. Please let me know your suggestions.
Thanks
Solved! Go to Solution.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 02:55 AM
In variables keep macro and summary macro field empty.
and Now add the widget as shown below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 02:29 AM
Hi,
Please try the way I mentioned in my below post. It will be hidden in RITM level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 02:32 AM
Hi Subhashree,
So is it not working for RITM view?
What happens when user opens the RITM in service portal -> is it not getting hidden?
What happens when user opens the RITM in native -> is it not getting hidden?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 01:42 AM
Service Portal: Catalog Item Buttons
Link to open in new window
Create Widget
In HTML:
<input type="button" value="Open Window"
onclick="window.open('http://w3.ibm.com')">
Variables FOR YOUR CATALOG ITEM
TYPR= UI Macro
Widget: Widget name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 01:46 AM
Service Portal: Catalog Item Buttons
Link to open in new window
Create Widget
In HTML:
<input type="button" value="Open Window"
onclick="window.open('http://w3.ibm.com')">
Variables FOR YOUR CATALOG ITEM
TYPR= UI Macro
Widget: Widget name