Name
sn_grc.SupportingDataUtilBase
Description
Support Util Base Class for functionality related to supporting data
Script
var SupportingDataUtilBase = Class.create();
SupportingDataUtilBase.prototype = {
initialize: function() {},
checkIfSupportingDataPresentForInidcatorTask: function(task) {
var indicator_task = new GlideRecord("sn_grc_indicator_supporting_data");
indicator_task.addQuery("task", task.getUniqueValue());
indicator_task.setLimit(1);
indicator_task.query();
return indicator_task.hasNext();
},
checkIfSupportingDataPresentForInidcatorResult: function(result) {
var indicator_result = new GlideRecord("sn_grc_indicator_supporting_data");
indicator_result.addQuery("result", result.getUniqueValue());
indicator_result.setLimit(1);
indicator_result.query();
return indicator_result.hasNext();
},
getTableName: function(encoded_query) {
var supporting_data = new GlideRecord("sn_grc_indicator_supporting_data");
supporting_data.setLimit(1);
supporting_data.addEncodedQuery(encoded_query);
supporting_data.query();
supporting_data.next();
return supporting_data.getValue('table');
},
getTableDisplayName: function(encoded_query) {
var supporting_data = new GlideRecord("sn_grc_indicator_supporting_data");
supporting_data.setLimit(1);
supporting_data.addEncodedQuery(encoded_query);
supporting_data.query();
supporting_data.next();
if (supporting_data.getValue('table')) {
var table_display = new GlideRecordSecure(supporting_data.getValue('table') + '');
return table_display.getClassDisplayValue();
} else {
return '';
}
},
getFieldsName: function(encoded_query) {
var fields = "";
var supporting_data = new GlideAggregate("sn_grc_indicator_supporting_data");
supporting_data.addAggregate('COUNT', 'field_name');
supporting_data.orderBy('field_name');
supporting_data.addEncodedQuery(encoded_query);
supporting_data.query();
var i = 0;
while (supporting_data.next()) {
if (i == 0)
fields += supporting_data.getValue("field_name");
else
fields += "," + supporting_data.getValue("field_name");
i++;
}
return fields;
},
type: 'SupportingDataUtilBase'
};
Sys ID
265f934e07951010e72bb5100ad300d3