Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Script Include calling Issue in Report

Not applicable

Not able to get the script include values in the report
Values is showing as NULL

JAYESHKUMARYA_1-1742449049994.pngJAYESHKUMARYA_2-1742449062777.png

Code Snippet :

var test = Class.create();
test.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    getMyid: function() {
        var arr = [];
        var gr = new GlideRecord('incident');
        gr.addQuery('sys_id', '57af7aec73d423002728660c4cf6a71c');
        gr.query();

        if (gr.next()) {
            // gs.info("Incident number: " + gr.number);
            arr.push(gr.sys_id.toString());
        }
        return arr;
    },

    type: 'test'
});

 

1 ACCEPTED SOLUTION

Chaitanya ILCR
Giga Patron

Hi @Community Alums ,

Check the Sandbox enabled checkbox on the script include and try

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

5 REPLIES 5

SanjivMeher
Mega Patron

I think in your script include, this is all you need and remove everything else. Then try in your report.

 

  function getMyid() {
        var arr = [];
        var gr = new GlideRecord('incident');
        gr.addQuery('sys_id', '57af7aec73d423002728660c4cf6a71c');
        gr.query();

        if (gr.next()) {
            // gs.info("Incident number: " + gr.number);
            arr.push(gr.sys_id.toString());
        }
        return arr;
    }

 


Please mark this response as correct or helpful if it assisted you with your question.

Not applicable

I tried but its returning NULL

JAYESHKUMARYA_0-1742450083958.png

 

 

Make the script include name identical to the function name. 

So script include name should be getMyid and in the report, just call javascript: getMyid();


Please mark this response as correct or helpful if it assisted you with your question.

Chaitanya ILCR
Giga Patron

Hi @Community Alums ,

Check the Sandbox enabled checkbox on the script include and try

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya