How can I migrate a extended table field to the parent field?

samuelscott
Tera Expert

I have a field that was initally reated on an extended table, but since its use is necessarry on other extended tables, I am trying to move it to the parent table.

Is there a easy way to do this without losing any data and without changing the column name, in other words, I want to do this without having any reprecussions.

 

I've looked into several community post and all, if not most, direct me to the same link that is not available anymore: http://www.servicenowguru.com/scripting/promote-field-extended-table-servicenow/

Thanks!

 

8 REPLIES 8

johnfeist
Mega Sage
Mega Sage

Hi Samuel,

You are probably best off putting the column into the base table.  It may take a little "fancy footwork" to do the initial set up.  You may need to do a one time operation to:

  1. create a new holding field in your extended table,
  2. copy the existing values to that field,
  3. delete the field you initially created
  4. recreate the field with the same name in the base table
  5. copy the values from the holding field to the base table field
  6. get rid of the holding field

It may sound like a lot, but once you understand the steps, unless you are dealing with lots of data, they should move quickly.

Having the data in a field on a table that extends some base table means that unless all the other tables where you need that value extend the one you already have, you get into the nightmare scenario of assuring that you have the right references built over and over.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Everything leads to the same line of code :

GlideDBUtil.promoteColumn('table_to_move_from', 'table_to_move_to', 'field_to_move', true);

it didn't work for me....i tried it on my dev instance

Ashvini Kadus1
Kilo Guru

Hi samuelscott,

 

Can you use below syntax:

GlideDBUtil.promoteColumn('table_to_move_from', 'table_to_move_to', 'field_to_move', true);

 

here in the first parameter you specify form which table the field we are promoting.

 

Hence i guess the field from only of table will be promoted unless you apply background script for both tables.

 

Kindly mark correct or helpful if it helps you to solve your problem.

 

Thank You,

Ashvini k