- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 03:09 AM
We can create UI action and can use below scrip.
Source table is Assessment Metric
Var cat_sys_id = current.sys_id.toString();
var attrs = new Packages.java.util.HashMap();
var table_name= 'custom_table';
var fname;
var src_table = new GlideRecord('asmt_metric');
src_table.addQuery('category', cat_sys_id);
src_table.query();
while(src_table.next())
{
fname = src_table.name;
var ca = new GlideColumnAttributes(fname);
ca.setType("string");
ca.setUsePrefix(true);
attrs.put(fname, ca);
}
var tc = new GlideTableCreator(table_name , table_name);
tc.setColumnAttributes(attrs);
if(typeof extends_table != 'undefined') tc.setExtends(extends_table);
tc.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 03:09 AM
We can create UI action and can use below scrip.
Source table is Assessment Metric
Var cat_sys_id = current.sys_id.toString();
var attrs = new Packages.java.util.HashMap();
var table_name= 'custom_table';
var fname;
var src_table = new GlideRecord('asmt_metric');
src_table.addQuery('category', cat_sys_id);
src_table.query();
while(src_table.next())
{
fname = src_table.name;
var ca = new GlideColumnAttributes(fname);
ca.setType("string");
ca.setUsePrefix(true);
attrs.put(fname, ca);
}
var tc = new GlideTableCreator(table_name , table_name);
tc.setColumnAttributes(attrs);
if(typeof extends_table != 'undefined') tc.setExtends(extends_table);
tc.update();