How to add a keyboard shortcut ?

praneeth07
Kilo Contributor

How to add a keyboard shortcut ?For example Ctrl+D should open a new incident form.Is it possible to do it in service now?

5 REPLIES 5

palmen
Tera Guru

Yeah it's doable.


We're using ctrl+q to open a new ticket



Create a global UI Script with the following code (there might be some OOTB scripts for this as well)



shortcut.add('Ctrl+q', function() {


  //Use parent location to avoid new url being loaded in the menu


  parent.gsft_main.location.href = "/ticket.do?sys_id=-1&sysparm_query=contact_type=phone^active=true&sysparm_stack=ticket_list.do";


});


Do I have to call this function()   from a client script?


Not sure what else is needed to get this to work. I tried this script in my developer instance but it obviously doesn't work.



Maybe someone else has some idea what is needed to make it work.


We got this function from our implementation partner so there might be other things you need to do as well that I'm not aware of.


Have a look at this page and you might get some help about what to do


Keyboard Shortcuts



When looking further we do have this long UI Script as well named in the thread in link above.