- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:00 PM
I want to display the record numbers that has the reference value selected.
For example:
When a "Key Matter Number" is selected, I want to display the record numbers in the Portal that have this Key Matter Number from the table record.
In the table, there are 3 records that has the "Key Matter Number" selected and I want these record numbers to be displayed in the Portal.
Is this possible?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 09:11 PM
you can use onChange catalog client script and GlideAjax and then bring the DEAL number and populate in single line text variable
OR
you can also use getReference with callback
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == '') {
g_form.clearValue('dealVariable'); // location variable name here
}
var ref = g_form.getReference('u_keyMattervariable', callBackMethod); // variable name
}
function callBackMethod(ref) {
if (ref.number)
g_form.setValue('dealVariable', ref.number); // your variable name & field here
}
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-24-2025 08:10 PM
Hi @ss123
Is it a catalog item that you want to display Deal Collection records after selecting a value in 'Key Matter Number' variable? if yes, in which type of variable you are trying to display Deal Collection record numbers?
If it is not a catalog item, are you referring to a Portal page and widget? if yes, you can write a simple JavaScript in Server script of widget and use the data object in HTML section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 08:33 PM
Yes it's a catalog item. The Deal Collection record numbers related to the selected Key Matter Number should be displayed under "Key Matter Number" field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 09:11 PM
you can use onChange catalog client script and GlideAjax and then bring the DEAL number and populate in single line text variable
OR
you can also use getReference with callback
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == '') {
g_form.clearValue('dealVariable'); // location variable name here
}
var ref = g_form.getReference('u_keyMattervariable', callBackMethod); // variable name
}
function callBackMethod(ref) {
if (ref.number)
g_form.setValue('dealVariable', ref.number); // your variable name & field here
}
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-24-2025 09:29 PM
Thank you @Ankur Bawiskar . I will try your suggestion.