Script Include - Glide AJAX enabled - not working?

eromlige
Tera Contributor

ver. Yokohama, PDI - I was  following steps found here: https://youtu.be/fcHhxT_f7T8

 

Exploring Dynamic Filter Options, followed his steps, exactly, but it does not work. It ONLY works if I select Sandbox enabled on the Script Include. It doesn't work when Mobile callable or Glide AJAX enabled are selected. Why? What's going on here?

Script include:

// Glide AJAX enabled [x]
var myPrimaryAssignmentGroup2 = Class.create();
myPrimaryAssignmentGroup2.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	getAssignmentGroup: function(user) {
        var gr = new GlideRecord('sys_user');
        gr.addQuery('sys_id', user);
        gr.query();

        var grp;

        if (gr.next()) {
            grp = gr.u_primary_assignment_group;
            gs.log("MyGroup: " + grp);
        }
        return grp;
    },
    type: 'myPrimaryAssignmentGroup2'
});

 


This works as a Background script, even if "Sanbox enabled" is not selected. What's happening here?

 

var dfo = new myPrimaryAssignmentGroup2().getAssignmentGroup(gs.getUserID());
gs.info("Assignment group: " +dfo);`

 


Anyone else seeing this?

3 REPLIES 3

Rohit  Singh
Mega Sage

Hi @eromlige ,

 

Please share the screen shot of script include and what do you mean by sandbox enabled?

 

Regards,

Rohit

Nishant8
Giga Sage

Hello @eromlige, The probable cause could be Security Hardening Settings enabled in your PDI. Can you check whether you have property 'glide.script.use.sandbox' enabled?

please refer following:

https://www.servicenow.com/docs/bundle/yokohama-platform-security/page/administer/security/reference...

Hey all,

@Nishant8 Setting that property to false and removing the check from, Sandbox enabled on the Script Include did not change the effect. It still only works in my PDI if Sandbox enabled is checked 😐

 

@Rohit Singh here's a shot of the script include.

Script Include - Sandbox enabled (selected)Script Include - Sandbox enabled (selected)