- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2025 08:09 PM
Hi All,
I have a reference field called "app name"on a custom table which refers to business application table.
Also i have a field called region which refers to cmn_location table in Business application table.
Another region field also present in custom table which value depends on the region of "app name" selected.
I want to auto populate region field in custom table with the same value of region field with respect to
the app name selected in the custom table.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2025 08:28 PM
something like this using 2nd approach
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == '') {
g_form.clearValue('regionFieldCustomTable'); // region field on custom table
}
var ref = g_form.getReference('appNameField', callBackMethod); // app name field name
}
function callBackMethod(ref) {
if (ref.regionField) // give the region field present on business app table
g_form.setValue('regionFieldCustomTable', ref.regionField); // give the region field present on business app table
}
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-09-2025 08:26 PM
2 options
1) show the Region field from the business app table as dot walked field -> why to create a new field to show Region
OR
2) use onChange client script with getReference callback and fetch and set the region field
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-09-2025 08:28 PM
something like this using 2nd approach
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == '') {
g_form.clearValue('regionFieldCustomTable'); // region field on custom table
}
var ref = g_form.getReference('appNameField', callBackMethod); // app name field name
}
function callBackMethod(ref) {
if (ref.regionField) // give the region field present on business app table
g_form.setValue('regionFieldCustomTable', ref.regionField); // give the region field present on business app table
}
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-10-2025 12:36 AM
Hope you are doing good.
Did my reply answer your question?
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-10-2025 07:20 PM
any update to this?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader