Notifications

209 views


Description


$sp.logStat is a call used to create a new entry in the sp_log table with a table name, a record sys_id from that name, and some type and optional comments. Handy for doing things like logging searches or visits to pages, etc.
 
This call exists on OOB widget "KB Article Page", however when cloning this widget and assigning the new widget to a Scope Application, this call doesn't work anymore. The reason why is that the call is unable to retrieve the correct data due to it now being in a Scoped Application.

Procedure


If you're doing a GlideRecord call and you're using this to call in data from elsewhere, you need to ensure that you're using a get call such as getValue. See the following example:
 
Global Application Scope
$sp.logStat('Kb Article View', "kb_knowledge", articleGR.getUniqueValue(), articleGR.short_description);
 
Non-Global Application Scope
$sp.logStat('Kb Article View', "kb_knowledge", articleGR.getUniqueValue(), articleGR.getValue('short_description'));
 
The differences would be in the last call, where we are now using getValue, instead of dot-walking directly to the short_description field.

Applicable Versions


All versions Applicable

 

Article Information

Last Updated:2018-09-04 19:48:48
Published:2018-08-31