How the canView() function in sn_sc catalog API is evaluated?

rajeshnvrk
Tera Contributor

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?

find_real_file.png

Regards,

Rajeshkumar

2 REPLIES 2

Pranesh072
Mega Sage
Mega Sage

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

Parameters

 

Name

TypeDescription
mobileBooleanTrue if the view is mobile view. Else, false.

 

 var catalog=new sn_sc.Catalog("e0d08b13c3330100c8b837659bba8fb4");;	
	         console.log (catalog.canView(false));

 

https://docs.servicenow.com/bundle/orlando-it-service-management/page/administer/mobile-employee/tas...

Imad Nacer1
Kilo Contributor

Hello @rajeshnvrk

I had the same problem and found that it returns true for categories that contain at least one Catalog Item.