
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 02:42 AM
Hello Team,
I need help on reference qualifier.
I have created a custom field(Type) of reference type in the RITM table and I have created a custom table where i am storing the combination of Catalog item and type value.
So my requirement is to show the type based on catalog item.
If catalog item is Storage then only show story type value in the field it is working perfectly with dependent field.
But issue is coming when catalog Item type is not present in the custom table then we have created some default type that should show. That is not working properly.
Can you please help me on that?
Regards,
Alok Gupta
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 04:40 AM
try this
Also you should call it like this
javascript: 'sys_idIN' + new getValueforType().getType(current.variables.catVariableName);
var getValueforType = Class.create();
getValueforType.prototype = Object.extendsObject(AbstractAjaxProcessor, {
initialize: function() {},
getType: function(cat) {
gs.info("aloky" + cat);
var type = [];
var gr = new GlideRecord('u_category_choice_lookup');
gr.addQuery('u_item', cat);
gr.query();
while (gr.next()) {
type.push(gr.sys_id.toString());
}
if (type.length == 0)
return 'sysId'; // give here the sysId of default record
else
return type.toString();
},
type: 'getValueforType'
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 04:40 AM
try this
Also you should call it like this
javascript: 'sys_idIN' + new getValueforType().getType(current.variables.catVariableName);
var getValueforType = Class.create();
getValueforType.prototype = Object.extendsObject(AbstractAjaxProcessor, {
initialize: function() {},
getType: function(cat) {
gs.info("aloky" + cat);
var type = [];
var gr = new GlideRecord('u_category_choice_lookup');
gr.addQuery('u_item', cat);
gr.query();
while (gr.next()) {
type.push(gr.sys_id.toString());
}
if (type.length == 0)
return 'sysId'; // give here the sysId of default record
else
return type.toString();
},
type: 'getValueforType'
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 05:08 AM
Thanks @Ankur Bawiskar It is working as expected.
Just one more thing how can we pass multiple default types.
I have 5 default types.
Can i pass through property?
or any other way.
I am doing like that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 05:32 AM
that property should have comma separated sysIds and property type should be String.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader