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

Script include to show only one approval record count in report from RITM table

Vijayaraya K
Tera Contributor

I am trying to create report from RITM table to get approver details where only one approver is active and rest of approvers are inactive.

We created Script include to fetch one active approver from RITM and used the same in real time report, but no data is displaying.

 

var ApprovalReportUtils = Class.create();
ApprovalReportUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    getApprovalRecords: function() {
       var user = gs.getUserID();
        var appGr = new GlideAggregate('sysapproval_approver');
        appGr.addQuery('approver', user);
        appGR.addAggregate('COUNT''approver');
        appGr.query();
        var approval_records = [];
        if (appGr.next()) {
           var ritmNo = approval_records.push(appGr.getValue('sysapproval'));   
        }
        var appCount = ritmNo.getRowCount();
        if (appCount == 1)
            return approval_records;
    },
    type: 'ApprovalReportUtils'
});
 

Although we tried with help of Related List conditions in a report.

VijayarayaK_0-1692024969196.png

 

Please help me on this.

Thank you 🙂

 

0 REPLIES 0