- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2014 07:56 AM
Hi Team,
The reference Qualifier is working perfectly fine apart from the scenario like if the Owners doesn't have any records in that particular table,it should not suppose to return any value in the reference field but it showing all the records instead.The Script is working perfectly fine for those Owners who is having record in that Table,and as per the requirement it should not show any values to those Owners in the reference field who doesn't have any records in the below mentioned table.
Here Is my Reference Qualifier and Script Include:
javascript:new AliasRefsort().alias(current.variables.Owner);
Script Include:
var AliasRefsort = Class.create();
AliasRefsort.prototype = {
alias: function(Owner) {
var aliasref = '';
//var owner=current.variable_pool.Owner;
var tableowner = new GlideRecord('u_email_object');
tableowner.addQuery('u_owner' , Owner);
tableowner.query();
while(tableowner.next()){
aliasref += 'sys_id=' + tableowner.sys_id + '^OR';
gs.log(aliasref);
}
return aliasref;
},
type: 'AliasRefsort'
};
Please assist...
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2014 08:03 AM
try this
var AliasRefsort = Class.create();
AliasRefsort.prototype = {
alias: function(Owner) {
var aliasref = [];
var tableowner = new GlideRecord('u_email_object');
tableowner.addQuery('u_owner' , Owner);
tableowner.query();
while(tableowner.next()){
aliasref.push(tableowner.sys_id.toString());
}
return 'sys_idIN'+aliasref.toString();
},
type: 'AliasRefsort'
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2014 08:02 AM
Can you try this.
javascript:new AliasRefsort().alias(current.variables.Owner);
Script Include:
var AliasRefsort = Class.create();
AliasRefsort.prototype = {
alias: function(Owner)
{
var aliasref = '';
var tableowner = new GlideRecord('u_email_object');
tableowner.addQuery('u_owner' , Owner);
tableowner.query();
while(tableowner.next())
{
aliasref += tableowner.sys_id + '^OR';
gs.log(aliasref);
}
return 'sys_id='+aliasref;
}
};
Regards,
Harish.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2014 08:03 AM
try this
var AliasRefsort = Class.create();
AliasRefsort.prototype = {
alias: function(Owner) {
var aliasref = [];
var tableowner = new GlideRecord('u_email_object');
tableowner.addQuery('u_owner' , Owner);
tableowner.query();
while(tableowner.next()){
aliasref.push(tableowner.sys_id.toString());
}
return 'sys_idIN'+aliasref.toString();
},
type: 'AliasRefsort'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2014 08:08 AM
Thanks a lot Kalaiarasan...I will mark it as correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2014 11:55 PM
Kalaiarasan P I am trying to check another condition
javascript:new AliasRefsort().alias(current.variables.owner)+'u_type=Conference Room Mailbox'
i am able to call script include but unable to check both conditions together
Please check