2

I am new to ServiceNow, I have created a standalone table like "u_myTable", but Now according to my requirement I wanted it to extend from "task" or "cmdb_ci" table. Is it any possible way to achieve this requirement.

2 Answers2

0

You can use the GlideTableParentChange Script Include. I've done this myself in a scoped application, but do test this in a non-production instance in case something unexpected happens with this.

I haven't tried to change a table from one base table to another with this in case that comes up in future requirements for you.

Credjt: https://community.servicenow.com/community?id=community_question&sys_id=2158cfaddb1cdbc01dcaf3231f961960

Important Notes

  1. Always test first in a test or development ServiceNow instance
  2. This script does work with tables with data in them, however I suggest only running this on new or empty tables.
  3. This is a manual step and isn't captured in an update set.

Steps to extend table

  1. Elevate your privileges to security admin
  2. In scripts - background run this script (replacing variables as needed)

Script:

//Replace <source_table> with the table you want to extend 
//Replace <table_extension> with the table you want to extend to, like cmdb_ci or task 
var table = '<source_table>'; 
var old_parent = ''; 
var new_parent = '<table_extension>';   
var changer = new GlideTableParentChange(table); 
changer.change(old_parent, new_parent);
Kirk
  • 16,182
  • 20
  • 80
  • 112
0

If you have not added anything to the table, I would delete the table and then create a new one. When you create a new table there's an option to extend it from another table.

ServiceNow Doc: Extend Table

techskipow
  • 21
  • 2