How the canView() function in sn_sc catalog API is evaluated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2021 10:02 PM
Hi,
We are trying to understand how the canView() function in sn_sc catalog API is evaluated?
When we try to use the below function it always returns false, we don't have any user criteria or role associated with catalogs.
on what basis the canView() at catalog level returns true?
Regards,
Rajeshkumar
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2021 11:25 PM
You can try User Criteria Diagnostics to see the reason
https://[instance].service-now.com/uc_item_diagnostics.do
You should pass "false" for desktop view
Name | Type | Description |
---|---|---|
mobile | Boolean | True if the view is mobile view. Else, false. |
var catalog=new sn_sc.Catalog("e0d08b13c3330100c8b837659bba8fb4");;
console.log (catalog.canView(false));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2021 03:20 AM
Hello @rajeshnvrk
I had the same problem and found that it returns true for categories that contain at least one Catalog Item.