Focus on worknotes on click of UI action!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2022 12:09 AM
Hi Community!
How do get I get the cursor/focus into 'work notes' onClick of UI action?
I have tried using var refocus=g_form.getElement('work_notes');
refocus.focus(); and also tried
g_form.getControl('work_notes').focus(); but none of the things are working!
Btw, I'm trying this in the Tokyo version!
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2022 12:25 AM
Hi,
Please check the following article on known issue with .focus() from servicenow.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694100
If above link does not help you then the better option would be to check the "client" checkbox on the UI action and in the client part of the script, make the work_notes mandatory, this will automatically take the focus to this field once the Ui action is clicked and if this field is empty.
Please mark the answer correct if above explanation helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 09:24 PM
Hi H_9,
Tried this already but not working !
Thank for the reply!