Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Reference qualifier not calling script include

Brijmohan
Tera Contributor

Hi, I have a requirement in catalog item. I have two variables "Search for people" and "Type keyword for search" based on this I want users should be display in reference fields called "search results" but it is showing all users.

I am using script include and advance reference qualifier but it is not working even no logs are showing in logs table.
Not sure what I am doing wrong.

getFilter: function(type, keyword, selectedUsers) {

        gs.info("GEVN_ONEIDM: type = " + type);
        gs.info("GEVN_ONEIDM: keyword = " + keyword);
        gs.info("GEVN_ONEIDM: selectedUsers = " + selectedUsers);

        if (!keyword || keyword=='' || keyword == 'undefined') {
            gs.info("GEVN_ONEIDM: No keyword entered");
            return 'sys_id=NULL';
        }

        var query = '';

        // SSO search
        if (type == 'sso') {
            query = 'user_nameLIKE' + keyword;
        }

        // First name / Last name search
        if (type == 'first_name_last_name') {
            query = 'first_nameLIKE' + keyword + '^ORlast_nameLIKE' + keyword;
        }

        // Email search
        if (type == 'email_address') {
            query = 'emailLIKE' + keyword;
        }

        // Manager search
        if (type == 'directly_reports_to') {

            gs.info("GEVN_ONEIDM: Searching manager using SSO");

            var mgr = new GlideRecord('sys_user');
            mgr.addQuery('user_name', keyword);
            mgr.setLimit(1);
            mgr.query();

            if (mgr.next()) {
                gs.info("GEVN_ONEIDM: Manager found = " + mgr.name);
                query = 'manager=' + mgr.sys_id;
            } else {
                gs.info("GEVN_ONEIDM: Manager NOT found");
                return 'sys_idISEMPTY';
            }
        }

        // Remove already selected users
        if (selectedUsers) {
            gs.info("GEVN_ONEIDM: Removing selected users");
            query += '^sys_idNOT IN' + selectedUsers;
        }

		if(!query){
			return 'sys_idISEMPTY';
		}

        gs.info("GEVN_ONEIDM FINAL QUERY: " + query);

        return query;
    },

 

 Reference qualifier in search result variable: 

javascript​: new global.GEVN_ONEIDM().getFilter(current.variables.v_search_for_people,current.variables.v_type_keyword_for_search,current.variables.v_people);

 

Screenshot 2026-03-12 003059.png
 
Regards,
Brij
1 REPLY 1

Zach Koch
Giga Sage

On your Script include, is the Client Callable checkbox checked? Since this is being used as a reference qualifier, you'll need that checked.

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!