How can we do this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
i have a reference field in my catalog item which gets the data from cmn_department table.
Whenever a user selects certain department the location field should automatically be populated. Also this has to be auto populated only when project type is renewal, which is a dropdown field
How can we do this effieciently.
For eg if the user selects -> 1234 North Atlantic as department then the location field should be populated as Atlantic.
Would client script work or we have to do with glide ajax?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi @Abdul,
the behaviour that you described will need two scripts:
- to reflect the change in the Department field
- onChange client script for native UI (backend),
- onChange catalog client script for Portal or ESC,
- if you want both UIs then both scripts are needed
- function in a script include
- can be re-used for both CS and CCS if used properly
You can get inspiration from this: GlideAjax Example Cheat Sheet (UPDATED)
Let me know how does it go
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
you can use onChange client script + getReference callback or GlideAjax for this
what did you start with and where are you stuck?
GlideAjax Example Cheat Sheet (UPDATED)
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader