Get the App
SLTechnology News&Howtos  ›  Servers  › 

How do I add or modify the extension table Extends table for the original table?

Shulou Source: shulou.com Published: 2022-06-03 05:41:15 10月02日 Update

If you create a new table and find that it is not extended from a table, it is recommended to delete and rebuild. Delete and rebuild need to be saved using two update set, otherwise you cannot see the update to UAT or PROD environment, and you should bear the consequences.

Using code to add or modify expansion tables is not approved by Servicenow. If your table already has a lot of functions after creation, if you are worried about data problems, it is recommended to contact SN, and a ticket can solve the problem. If you directly use this code, resulting in data mismatch and other problems, at your own risk (SN also said the same).

First of all, declare that this can add or modify the extension table Extends table for the original table. Please go to the personal example to test it yourself.

The code is as follows:

/ / Replace with the table you want to extend

/ / Replace with the table you want to extend to, like cmdb_ci or task

Var table =''

Var old_parent =''

Var new_parent =''

Var changer = new GlideTableParentChange (table)

Changer.change (old_parent, new_parent)

Code is not enough. The location of its execution is very important. Create a fix script under Global, enter the code and execute it. Please study the options of fix script by yourself. Just execute it once.

Note: GlideTableParentChange can only be used under Global. Using this code changes the original table sys id, which is why the disclaimer is made.

Tags: Code original company consequences suggestions data issues important not enough two individuals that is practices functions causes locations examples environments or exemptions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Apple MySQL Shulou Technology Docker