Child Field moved to Parent

bmhenry
Kilo Contributor

How would I be able to move a field from a child table to the task table? I searched on here and the link that was listed everywhere is no longer working. I already have data in those fields and I want to retain that data.

Move From

Table IRS - u_current_status

to

Table Task - u_current_status

6 REPLIES 6

Jaspal Singh
Mega Patron
Mega Patron

Hi Henry,

 

Only possibility would be update it via script but can you elaborate more about it. Like what field & when it should copy the status.

 

Thanks,

Jaspal Singh

Tushar Hirpurk1
Mega Guru

Hi,

    Please refer below link might be helpful for you:-

https://hi.service-now.com/kb_view.do?sysparm_article=KB0743116

 

Please mark reply as Correct/Helpful, if applicable. Thanks!

 

Regards,

Tushar

 

Anil Shewale
Mega Guru

Hi

 

If there is any specific field you have created on the Child Table and Now you want to make the field available on the Task Table then the only solution would be to Move your Custom field created on the Incident table to the Task Table using the Below script.

You need to run this in Background Script:

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

For Example I had to move the Field Impact1 from Incident to task Table then I can write the code as below;

example:

GlideDBUtil.promoteColumn('incident', 'task', 'u_impact1', true); //make change according to your table name.

So once this Script is Run in the Background Script, The field will be moved from Incident to Task allowing you to make it available in the Task List View.

for more refer ..

https://community.servicenow.com/community?id=community_question&sys_id=cd9f7ee9db58dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=b9247529db2a7b84a39a0b55ca96...

 

If it help mark helpful or correct 

Thanks and regards

Anil

Swapnil Soni1
Giga Guru

Hi,

You can use the GlideDBUtil.promoteColumn(sourceTable, targetTable, column) function call

 

sourceTable: table that contains the column that needs to be promoted. must be child of the targetTable

 

targetTable: table that will have the column after promoted

 

column: the column to promote

 

 

 

I haven't used this in a long time and have not tested it since we introduced Task Table Flattening, where different fields in the Dictionary can occupy the same field in the database. As such I would maintain caution and test this with a dummy field first on a developer/demo Instance.

 

 

EDIT: throw -> maintain

 

Or you can go through it for another solution

https://hi.service-now.com/kb_view.do?sysparm_article=KB0743116

 

Please mark correct or helpful.

Thanks

Swapnil