Display extended table fields in form layout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 10:40 PM
Hi
I can see that we can display extended table fields in 'List layout'
But is there any way i can display extended table fields in 'Form Layout'?
Regards
Hetal
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 11:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 11:56 PM
Hi Nitin
I dont extended tabled field not the reference fields
e.g. in task form i want to view incident table's outage fields
Any thoughts around that
Regards
Hetal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2017 12:01 AM
Hetal means extended fields, not reference fields.
E.g. from Server form, display fields on Windows Server CI (which extends Server) table.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2018 05:35 AM
Hello Everyone I have found the solution using Script Please mark as helpful and hit like
--------------------------------------------------Adding field to formlayout of all child tables using script-------------------------------------------------------------
var tu = new TableUtils("u_test"); //base table name
var classes = tu.getHierarchy();
gs.include("j2js");
var jsClasses = j2js(classes); //get all child table as well as base table
var arr=[];
var gr= new GlideRecord('sys_ui_section');
gr.addQuery('name', 'IN', jsClasses);
gr.addEncodedQuery('view=Default view^captionISEMPTY');
gr.query();
while(gr.next()){
arr.push(gr.getValue('sys_id')); //push the sys_id of the ui section with empty caption
}
for (i=0; i < arr.length; i++){
var gr1= new GlideRecord('sys_ui_element');
gr1.initialize();
gr1.sys_ui_section=arr[i];
gr1.position=-1; //position of the field on form
gr1.element='u_final'; //field to be added on all form layout
gr1.insert();
}
----------------------------------------------------------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 01:06 PM - edited ‎12-27-2023 01:08 PM
Our solution to this can be found: https://www.servicenow.com/community/developer-forum/how-to-get-extended-table-fields-on-parent-tabl...
Basically we created another column on the table that is a reference to the extending/child table and maintain its value via a business rule. Then we just use that new field to get display the fields we want on the form view.
EX Business Rule Advanced Script:
(function executeRule(current, previous /*null when async*/) {
var extendingRecord = null;
var extendingRecordGr = new GlideRecord('extending_table');
if(extendingRecordGr.get(current.base_table.sys_id)) {
extendingRecord = current.base_table;
}
current.u_extending_record = extendingRecord;
})(current, previous);