How to make the checkbox for switching between work notes and comments default to comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
I have a request to make the checkbox in the screen above, default to SHARED WITH CALLER COMMENTS instead of defaulting to whatever the user used last, which seems the normal behavior. I tried adding an onLoad client script-
function onLoad() {
// Sets default to "Additional Comments" (Shared with Caller)
// Replace 'incident' with your table name
setPreference('glide.ui.incident.stream_input', 'comments');
}But this does not seem to work reliably. Does anyone have some tips on how to accomplish this?
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Also tried-
function onLoad() {
// If the user can write additional comments, put focus there by default
try {
if (g_form.getControl('comments')) {
g_form.setFocus('comments');
}
} catch (e) {}
}Same result though, does not default to comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Why would you want to mess with this? This could lead to very unwanted results. These are user preferences, so you could update those (if changes to comments, set work notes), but this is a requirement that should be challenged.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 4 hours ago
Hi @jlaps
Is it for native UI /workspace UI.
For Native view: user preference you needs to set the preference using glideRecod.
If it is Workspace UI, then check this KB article: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0760076
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
I agree with what @Mark Manders mentioned.
This will lead to confusion.
Instead train the agents about the OOTB platform behavior and avoid heavy customization.
💡 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 || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
