The CreatorCon Call for Content is officially open! Get started here.

\$sp.showCatalogPrices()

jasonalldridge
Kilo Expert

Hi,

$sp.showCatalogPrices() is shown in the server code of a number of widgets, but Ive not been able to find any documentation to date about exactly what this is doing.

Is anybody able to help out here? Where does it retrieve this value from?

Thanks

1 ACCEPTED SOLUTION

jesseadams
ServiceNow Employee
ServiceNow Employee

Hey Jason,


You're right, that function is not documented API so the functionality could vary some from release to release but, it looks like that function looks at the system property glide.sc.price.display and returns true as long as the value of that property is not "never".


View solution in original post

3 REPLIES 3

jesseadams
ServiceNow Employee
ServiceNow Employee

Hey Jason,


You're right, that function is not documented API so the functionality could vary some from release to release but, it looks like that function looks at the system property glide.sc.price.display and returns true as long as the value of that property is not "never".


Thanks Jesse



That does the trick!


Hi Jason,



Adding to Jesse, The GlideSPScriptable API provides a set of methods for use in Service Portal Widgets.We can access GlideSPScriptable methods by using the global $sp object. But we do not have any documentation for showCatalogPrices(). Please find the rest documentation below.


https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&id=c_GlideSPScriptableScopedAPI


I did some research on this and found that $sp.showCatalogPrices() returns true/false value on the basis of property glide.sc.price.display as mentioned above.


1. For value as 'non_zero' and 'always' it will return true.


2. For value as 'never' it returns false.



Hope this helps.


Regards


Ujjawal