Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to make the checkbox for switching between work notes and comments default to comments

jlaps
Kilo Sage

e8ec60cc-602f-4f81-8668-bb16cf70024a.png

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

4 REPLIES 4

jlaps
Kilo Sage

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 Manders
Giga Patron

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

Tanushree Maiti
Giga Sage

Hi @jlaps 

 

Is it for native UI /workspace UI.

 

For Native view: user preference you needs to set the preference using glideRecod.

Refer: https://www.servicenow.com/community/developer-forum/set-user-preference-when-user-added-to-a-group/...

 

 

If it is Workspace UI, then check this KB article: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0760076

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Ankur Bawiskar
Tera Patron

@jlaps 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader