- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 12:38 AM
Hi Team,
I wonder why the auto-populate field is not working in portal view but working in technical view.
Hence im trying to create a onchange script to get the phone territory but its not working any idea how can I achieve this ?.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.getReference('who_is_this_request_for', function(user) {
if (user.location) {
g_form.getReference(user.location, function(location) {
if (location.parent) {
g_form.getReference(location.parent, function(parentLocation) {
if (parentLocation.phone_territory) {
g_form.getReference(parentLocation.phone_territory, function(phoneTerritory) {
var ccc = phoneTerritory.ccc
var displayValue = '+' + ccc;
g_form.setValue('phone_number', displayValue);
});
}
});
}
});
}
});
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 02:01 AM
it clearly means the user doesn't have read access to that referenced table and hence cannot bring the data.
you are doing multiple getReference with callback which is not good at client side.
Please use normal onChange + GlideAjax and use GlideRecord and see if that works fine.
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-12-2025 02:05 AM
Hi @Jeck Manalo
Looks like the user doesn't have access for that table.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 12:39 AM
Hi @Jeck Manalo
You an try the Auto-populate feature in Variable level where no code is required.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 01:07 AM
hi,
just figure out it work in technical view and portal view using admin account but its not working in normal account.
Any idea about this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 01:12 AM
Hi @Jeck Manalo
What is normal account mean here? and when you not working means not populating valeue?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 01:34 AM
normal account means a user who will raise a request for the catalogs.
so in the screenshot i provided there is two different user where user that has no role or something and an admin user account.