Form Sections Archives - ServiceNow Guru https://servicenowguru.com/tag/form-sections/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 20:52:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 https://servicenowguru.com/wp-content/uploads/2024/05/cropped-SNGuru-Icon-32x32.png Form Sections Archives - ServiceNow Guru https://servicenowguru.com/tag/form-sections/ 32 32 What you may not know about Forms, Form Sections, and Views https://servicenowguru.com/system-ui/forms-form-sections-views/ https://servicenowguru.com/system-ui/forms-form-sections-views/#comments Tue, 30 Nov 2010 16:18:51 +0000 https://servicenowguru.wpengine.com/?p=1841 One of the most basic things you learn as a Service-now.com administrator or consultant is how to personalize a form. I remember when I was first introduced to Service-now how cool it was that you could just right-click and manipulate the fields on a form or a view. Service-now added more flexibility later with the

The post What you may not know about Forms, Form Sections, and Views appeared first on ServiceNow Guru.

]]>
One of the most basic things you learn as a Service-now.com administrator or consultant is how to personalize a form. I remember when I was first introduced to Service-now how cool it was that you could just right-click and manipulate the fields on a form or a view. Service-now added more flexibility later with the introduction of form sections and tabbed forms.
This ease of use didn’t really translate for me when it came to understanding what was really going on behind the scenes. If I ever ran into a problem with my form or needed to change the arrangement or labels of existing form sections it seemed to take me forever to find the correct place to make the change.
This post is written to hopefully eliminate some of the confusion with how forms, sections, and views relate and are stored in Service-now. I’m not going to go into any of the standard personalization details because those are all outlined in the wiki. Below is an outline of the table structure, relationships, and usage of forms, form sections, and views.


Form – ‘sys_ui_form’:

Container for multiple form sections. A form section only exists if a table has a view that includes multiple form sections (sections). Each form record must be associated with a corresponding view record (even if the view is the default view). It is possible to have multiple form records for a particular table, each associated with a different view and sections.

–Navigation:

System UI -> Forms (or type ‘sys_ui_form.list’ in your left nav filter)

–Usage:

Forms should only be created by personalizing a form and creating a second form section for a view. The only reason to modify a form record directly would be to change the view that the form is associated with. Form records can be useful for navigation purposes when you want to see what form sections are part of a given multi-section form. The ‘Form Sections’ related list on the ‘Forms’ default view is also the best place to change the ordering of form sections on a given form.

Form Section (Section) – ‘sys_ui_section’:

This table is called ‘Form Section’, but it might be clearer to think of it just as ‘Section’. A section is collection of form section elements (fields, splits, annotations, and formatters) displayed on a form. Each section record must be associated with a corresponding view record (even if the view is the default view).

–Navigation:

System UI -> Forms (or type ‘sys_ui_section.list’ in your left nav filter)

–Usage:

Sections should only be created through the ‘Personalize Form’ UI. You may need to access these records directly if you want to see what elements are part of a particular form section or if you want to see if the form section is part of a multi-section form. You can also change the view a form section is related to or the caption for a section from the form section record. Section records are really the one place where forms, sections, and views are all linked together. As such, they are usually my starting point for navigation when I’m trying to modify something form-related that can’t be changed through the ‘Personalize Form’ UI.

Form-Section (m2m relationship table) – ‘sys_ui_form_section’:

Probably the most confusing of the bunch until you learn what it is. Contrary to what the label leads you to believe, this is not a form section at all! The ‘Form Section’ table is just a many-to-many relationship table that links forms and form sections (sections) together. This link is only created when you create a multi-section form.

–Navigation:

Type ‘sys_ui_form_section.list’ in your left nav filter (or view the ‘Form Sections’ related list on any Form or Section record)

–Usage:

If you’ve ever had a form section “disappear” on a multi-section form then this was probably your problem. The fix for those issues is typically just to create a new relationship record between the form and section in this table. You can also modify the ordering of form sections on a multi-section form by modifying the ‘Position’ field on these records.

The out-of-box Change Request form for the default view shows how all of these elements link together.

View – ‘sys_ui_view’:

Container for forms, form sections, lists, and related lists (all of which can come from various tables). A single view name can be used across many tables. For example, the ‘ess’ (Self-service) view is used by form sections on the Incident, User, and Request tables (among others) out of box.

–Navigation:

System UI -> Views (or type ‘sys_ui_view.list’ in your left nav filter)

–Usage:

Views should always be created through the ‘Personalize Form’ or ‘Personalize List’ UI. The only reason you would need to modify a view record is if you want to change the name of the view. Since views can apply to multiple tables, forms, lists, and related lists there’s a lot of information contained underneath a view record typically. It can be useful as a reference to see how all of the pieces fit together though. One thing to keep in mind when working with view records or references is that the majority of the forms and form sections in the system relate to the ‘Default’ view.

The post What you may not know about Forms, Form Sections, and Views appeared first on ServiceNow Guru.

]]>
https://servicenowguru.com/system-ui/forms-form-sections-views/feed/ 11
Changing the Active Tab Selection in ServiceNow https://servicenowguru.com/client-scripts-scripting/changing-active-tab-selection-servicenowcom/ https://servicenowguru.com/client-scripts-scripting/changing-active-tab-selection-servicenowcom/#comments Wed, 29 Sep 2010 16:41:16 +0000 https://servicenowguru.wpengine.com/?p=2149 ServiceNow has a nice tabbed form interface that allows users to save some screen real estate by collapsing all form sections and related lists and presenting them in a tabbed format. Tabbed forms are explained on the ServiceNow wiki. This post explains how you can use client scripting to change the active tab selection in

The post Changing the Active Tab Selection in ServiceNow appeared first on ServiceNow Guru.

]]>
ServiceNow has a nice tabbed form interface that allows users to save some screen real estate by collapsing all form sections and related lists and presenting them in a tabbed format. Tabbed forms are explained on the ServiceNow wiki.
This post explains how you can use client scripting to change the active tab selection in a form section or a related list. This might come in handy if you want to make a particular tab of information more visible in different situations. Special thanks to Joseph Bennett for doing the real work figuring this out for me :).



These functions are pretty simple. The key is figuring out the ID number of the tab that you want to select. Tabs are numbered in order, left to right, starting at 0.

Change Active Tab Selection for Form Sections

So, if I wanted to select the ‘Change, Backout, and Test Plan’ tab in the image above I would use this line of code in a client script…

g_tabs2Sections.setActive(1);

You can change the active tab selection by name by using a script like this (where ‘Change, Backout, and Test Plan’ is the name of your tab)

var tabName = 'Change, Backout, and Test Plan';
var myTabs = $('tabs2_section').select('span[class="tab_header"]');
var answer = 0;
for (i = 0; i < myTabs.length; i++) { var inner = myTabs[i].innerHTML.replace(/&nbsp;/g, ' '); if(inner.indexOf(tabName) > -1) {
answer = i;
break;
}
}
//Display the selected section
g_tabs2Sections.setActive(answer);

Change Active Tab Selection for Related Lists

If I wanted to select the ‘Affected CIs’ related list tab in the image above I would use this line of code in a client script…

g_tabs2List.setActive(3);

You can change the active tab selection by name by using a script like this (where ‘Affected CIs’ is the name of your tab)

var tabName = 'Affected CIs';
var myTabs = $('tabs2_list').select('span[class="tab_header"]');
var answer = 0;
for (i = 0; i < myTabs.length; i++) { var inner = myTabs[i].innerHTML.replace(/&nbsp;/g, ' '); if(inner.indexOf(tabName) > -1) {
answer = i;
break;
}
}
//Display the selected section
g_tabs2List.setActive(answer);

Want to learn more about controlling the behavior of tabs and form sections in ServiceNow? Check out these other articles for more information!

The post Changing the Active Tab Selection in ServiceNow appeared first on ServiceNow Guru.

]]>
https://servicenowguru.com/client-scripts-scripting/changing-active-tab-selection-servicenowcom/feed/ 15