his post comes to you from ServiceNow’s Knowledge14 event in San Francisco. It’s exciting to see all of the new innovations that ServiceNow is introducing in the upcoming releases. I’ve been very involved with my company, Crossfuze Solutions, as a sponsor of the conference and it’s been incredibly rewarding to showcase our solutions and talk to so many of you about how Crossfuze and ServiceNow Guru have helped you to be successful in implementing and enhancing ServiceNow. If you’re here at the conference, please stop by booth #421 during the expo hours and say hello!
Today’s post comes in response to a question posted on the ServiceNow community about providing more granular control over the form and list tabbing behavior for specific tables and conditions. If you’re familiar with ServiceNow, you know that this cannot be done natively and that tabbing is based off of a user preference that is enforced globally for the user accessing the system. Continue reading to see how to add more flexibility to your form tab behavior!
‘tabbed.forms’ User Preference
As background, the first thing you should know is that the user preference (accessed from the ‘User Preferences’ module) that controls this behavior is ‘tabbed.forms’. You can set this globally as a default or set it individually directly from the table record if needed.
Controlling the ‘tabbed.forms’ User Preference from a client script
In most cases, simply clicking the icon in the top-right corner is all you need to toggle tabbing within your forms. In the event that you need to do that through scripting, a client script is your answer. You can toggle the tabbing globally for a user with the following code…
Granular control…WITHOUT impacting the user preference
The problem with the script above is that YOU’LL PROBABLY NEVER USE IT! I can’t think of a single scenario where you would want to toggle tabs and have that user preference enforced for a user globally. You’d just set the global default preference and be done with it.
This becomes MUCH more useful though if you can control the tabbing behavior without modifying the system property. Maybe you want to just expand the form sections for a particular table based on a specific condition without impacting the list tabs and without impacting the behavior anywhere else. The following can be used in your client scripts to accomplish this…
g_tabs2Sections.activate(); //Activate form tabs
g_tabs2List.activate(); //Activate list tabs
Want to learn more about controlling the behavior of tabs and form sections in ServiceNow? Check out these other articles for more information!