- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 02:31 AM
Hi All,
I have requirement to capture lot of form layout with its all sections (Including all section it is almost 400), now I need to do this manually, but Is there any way I can do this with script or any other efficient way?
Thanks
Regards,
Abhijit
ServiceNow MVP
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2019 03:59 AM
Hi All,
I have implemented this with script. Basically when we change form layout, system captures form section (sys_ui_section table) with all it's associate element (sys_ui_element). I did the similar thing with script.
I wanted to do this for three views then I did with below script,
var viewSysIDs=['2e319f86db706b406622f97e0f96198c','baa70bcbdbb8eb406622f97e0f961962','df704387dbb8eb406622f97e0f9619db'];
for(i=0;i<viewSysIDs.length;i++)
{
var grSection=new GlideRecord('sys_ui_section');
grSection.addQuery('view',viewSysIDs[i]);
grSection.query();
while(grSection.next())
{
var umSection= new GlideUpdateManager2();
umSection.saveRecord(grSection);
var grElement=new GlideRecord('sys_ui_element');
grElement.addQuery('sys_ui_section',grSection.sys_id);
grElement.query();
while(grElement.next())
{
var umElement = new GlideUpdateManager2();
umElement.saveRecord(grElement);
}
}
}
Hope this will help someone in future.
Thanks everyone for your help.
Regards,
Abhijit
ServiceNow MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 02:43 AM
Hi
You want to capture the form layout and that form layout you want to move from one instance to another instance. if it is correct .
So please create a update set and disign your form according to your requirements and complete that update set and move it to other instance Click here for more details about update set.
Please mark as correct and helpful if my suggestion helped you.
Thanks
Sanjay Bagri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 03:04 AM
Thanks Sanjay for reply.
I want to know other ways than manually doing this because I have more than 400 sections to capture.
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 05:07 AM
Hey Cody,
Please refer the below link which might help to solve your query: -
Thanks,
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2019 03:59 AM
Hi All,
I have implemented this with script. Basically when we change form layout, system captures form section (sys_ui_section table) with all it's associate element (sys_ui_element). I did the similar thing with script.
I wanted to do this for three views then I did with below script,
var viewSysIDs=['2e319f86db706b406622f97e0f96198c','baa70bcbdbb8eb406622f97e0f961962','df704387dbb8eb406622f97e0f9619db'];
for(i=0;i<viewSysIDs.length;i++)
{
var grSection=new GlideRecord('sys_ui_section');
grSection.addQuery('view',viewSysIDs[i]);
grSection.query();
while(grSection.next())
{
var umSection= new GlideUpdateManager2();
umSection.saveRecord(grSection);
var grElement=new GlideRecord('sys_ui_element');
grElement.addQuery('sys_ui_section',grSection.sys_id);
grElement.query();
while(grElement.next())
{
var umElement = new GlideUpdateManager2();
umElement.saveRecord(grElement);
}
}
}
Hope this will help someone in future.
Thanks everyone for your help.
Regards,
Abhijit
ServiceNow MVP