- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 11:42 PM
Hi,
We need to hide certain catalog item from a catalog when it is shown in service portal. Instead of making "Active==false" in maintain items, how to hide it from the widget.
I'm using a "catalog content" widget to show the items in a catalog.
Please help us with a solution.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2017 09:39 PM
Hi Nawaz,
I have used "nameINabc,xyz" to achieve this.Thank you so much for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 12:00 AM
If you want a permanent solution fro this then follow below procedure.
1. Create an additional field on 'sc_cat_item' say 'hide on portal' of type checkbox..
2. Clone the widget and add additional condition in the server code.
var sc = new GlideRecord('sc_cat_item_category');
if (data.category_id)
sc.addQuery('sc_category', data.category_id);
sc.addQuery('sc_cat_item.u_hide_on_portal',true);
sc.addQuery('sc_cat_item.active',true);
sc.addQuery('sc_cat_item.sys_class_name', 'NOT IN', 'sc_cat_item_wizard');
sc.orderBy('sc_cat_item.order');
sc.orderBy('sc_cat_item.name');
sc.query();
3. Now you just need to check that hide on portal checkbox for the item you want to hide on portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 12:03 AM
Catalog content is not the only widget for catalog items there you may need to modify other widgets as well.. . Sc Category page . You may also need to consider catalog search results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 12:44 AM
You can add encoded query in the widget where you are querying for cat_items. In the encoded query just say "name!=abc^name!=xyz"
var query="name!=abc^name!=xyz";
var obj=new GlideRecord('table_name');
obj.addEncodedQuery(query);
....
....
...
.obj.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 03:16 AM
Hi Nawaz,
Thank you for your reply. I'm glad it helped us
Regards,
Gopi