Name
sn_grc.PAIndicatorStrategyBase
Description
PA strategy for the indicators
Script
var PAIndicatorStrategyBase = Class.create();
PAIndicatorStrategyBase.prototype = Object.extendsObject(IndicatorStrategy, {
run: function() {
var resultId = "";
// Retrieve the table of the profile documentId
var item = this.indicatorRecord.item;
if (item != null) {
var profile = item.profile;
var table = item.sys_class_name + '';
if (profile != null) {
var gr = new GlideRecord("sn_grc_indicator_result");
gr.addQuery("indicator", this.indicatorRecord.sys_id);
gr.addEncodedQuery("collection_dateONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)");
gr.query();
if (gr.next())
resultId = gr.getUniqueValue();
else
resultId = this.addResult(true, "", "", "");
} else {
if (table === 'sn_risk_risk')
gs.addErrorMessage(new sn_grc.GRCUtils().getMessage("profile_has_no_item_rk"));
else if (table === 'sn_compliance_control')
gs.addErrorMessage(new sn_grc.GRCUtils().getMessage("profile_has_no_item_ct"));
}
} else
gs.addErrorMessage(gs.getMessage("The indicator has no control or risk associated"));
return resultId;
},
type: 'PAIndicatorStrategyBase'
});
Sys ID
68edf707c323020044b2db1122d3ae71