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.
Asked
Active
Viewed 1,066 times
2 Answers
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.
Important Notes
- Always test first in a test or development ServiceNow instance
- This script does work with tables with data in them, however I suggest only running this on new or empty tables.
- This is a manual step and isn't captured in an update set.
Steps to extend table
- Elevate your privileges to security admin
- 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.

techskipow
- 21
- 2