Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Override Calculated value

SRI Sakthi
Tera Contributor

Hi Guys,

           I am trying to call script include from Dictionary override- calculation field but it's not working .can you help me to fix this issue?

find_real_file.png

15 REPLIES 15

BryanS413339635
Tera Guru

Can you post the script include? The format you have here looks correct

SRI Sakthi
Tera Contributor

Hi bryanshaw,

it's  my Script include:

var datedetails = Class.create();
datedetails.prototype = {
    initialize: function() {
    },

getDate:function(csid)
    {
       
    var gr = new GlideRecord("alm_asset");
        gr.addQuery("ci",csid);
        gr.query();
        if (gr.next()) {
         
                         return gr.warranty_expiration;
                           }
                  
                    
            }

},

  type: 'datedetails '
};

i called script include like:  javascript:new global.datedetails().getDate(current.cmdb_ci)

Seems, Script include is not client callable.

Can you replace 1st two lines

from

var datedetails = Class.create();
datedetails.prototype = {

to

var datedetails = Class.create();
datedetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {

And make sure you check the Client callable: True

Sorry, It's not working..