- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 06:09 AM
I want to display a button widget when viewing a specific catalog item in Service Portal.
If I can get the name of the catalog item, I would like to set it to the display condition of the button widget.
Is it possible to get the information of the catalog item displayed on the screen?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 06:15 AM
hello ,
yes you can get it in server side of the widget
you can use this method to get the sys_id of the catalog item and glide record to maintain items table and get the name of the catalog item like below
data.catItemName="";
var gr = new GlideRecord('sc_cat_item');
gr.addQuery('sys_id',$sp.getParameter('sys_id'));
gr.query();
if(gr.next())
{
data.catItemName= gr.name;
}
Hope this helps
please mark my answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 06:15 AM
hello ,
yes you can get it in server side of the widget
you can use this method to get the sys_id of the catalog item and glide record to maintain items table and get the name of the catalog item like below
data.catItemName="";
var gr = new GlideRecord('sc_cat_item');
gr.addQuery('sys_id',$sp.getParameter('sys_id'));
gr.query();
if(gr.next())
{
data.catItemName= gr.name;
}
Hope this helps
please mark my answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 09:26 AM
Worked perfectly!
thank you!