Name
sn_ect.EmployeeTaxonomyUtilSNC
Description
WARNING Customers should NOT modify this script The purpose of this script include is to provide default behaviours for the EmployeeTaxonomyUtil script include. To change the behaviour of these methods (or add new methods), Customers should override/add new methods to the EmployeeTaxonomyUtil script include.
Script
var EmployeeTaxonomyUtilSNC = Class.create();
EmployeeTaxonomyUtilSNC.prototype = {
initialize: function() {
this.EMPLOYEE_TAXONOMY = '1f5d5a40c3203010069aec4b7d40dd93';
},
/**
* This function deactivates and activates and all the topics of 'Employee' which in turn updates the primary topic field ('taxonomy_topic') for all the content assoicated to this taxonomy. This step is required to make Search configurations work with OOTB Employee taxonomy.
**/
toggleTopicsActiveState: function() {
if (!gs.hasRole('taxonomy_admin')) {
gs.info(gs.getMessage("User {0} does not have write access to the given taxonomy and its topic", [gs.getUserID()]));
return;
}
var topicGr = new GlideRecord('topic');
topicGr.addQuery('taxonomy', this.EMPLOYEE_TAXONOMY);
topicGr.addActiveQuery();
topicGr.query();
while (topicGr.next()) {
topicGr.setValue('active', false);
topicGr.update();
topicGr.setValue('active', true);
topicGr.update();
}
},
type: 'EmployeeTaxonomyUtilSNC'
};
Sys ID
6dfaf952c7513010fedf0bcbe2c260ca