how to call script include from ux client script include

khadir
Kilo Contributor

i have one ux client script include where iam calling script  include using glide ajax, can any one tell me whether it is the correct process or not  because iam not getting response.

 

find_real_file.png 

and in ui builder i have one client script there i am exporting ux client script include.

 

find_real_file.png

thanks in advance.

 

6 REPLIES 6

AkshatRastogi
Mega Guru

Hi,

Script include is a server side script, you can make it client callable and call it within the client script using Ajax call.

However, within script include, if you are calling another script include, you dont need ajax.

Hello @AkshatRastogi,

You said - " if you are calling another script include, you dont need ajax".

I am facing same issue,

could you please provide any example if possible?

Hi not sure if you are still facing the issue but below is an example where incident caller id field is populated only if the user has certain domain:

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

    updateIncidentCaller: function (incidentSysId, userSysId) {
        var domainChecker = new DomainCheckUtils();  // Another script include
        if (domainChecker.hasGmailDomain(userSysId)) {
            var incidentGR = new GlideRecord('incident');
            if (incidentGR.get(incidentSysId)) {
                incidentGR.caller_id = userSysId;
                incidentGR.update();
            }
        }
    },

    type: 'IncidentUtils'
};

 

Manuel2
Tera Contributor

Hi Khadir,

 

Did you manage to call the Script include finally?

 

I am trying to do the same to use Script includes in the UI builder