How to promote out of the box field from Child to Parent table?

dvelloriy
Kilo Sage

Hi Community,

I have an out of the box field "Version" on cmdb_ci_appl table.

We need to promote this field to cmdb_ci table. Any recommended way of doing that?

I know we have a method "GlideDBUtil.promoteColumn(sourceTable, targetTable, column) function call which i dont want to use as it is not recommended by ServiceNow and not sure if this would work in Madrid as per the below article.

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

Please advise.

Thanks in advance.

4 REPLIES 4

Paul Porter
Tera Expert

Did you happen to see the workaround options mentioned in the referenced KB article?

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

I am not sure I would recommend that given "version" exists on 236 extended cmdb_ci class tables.  Why do you need to move it up to the parent cmdb_ci table.  But regardless if you do create a new one it would be called "u_version" instead and you could create a fix script to populate the value from version into the u_version field and then have a BR that maintains both IF the version field exists in the extended class.

 

This is also a good "Idea" to submit in the Idea portal.

Giles Lewis
Giga Guru

Please mark Michael Ritchie's reply as Correct. Even if it works, it is a bad idea to promote an out-of-box field.

Chavan AP
Kilo Sage

hey hi

wanna try something as below:

 

function onBefore(current, previous) {

    //This function will be automatically called when this rule is processed.

  var parent = current.parent.getRefRecord();

  parent.u_version = current.u_version;// u will have to create custom field on parent table
   
  parent.update();


}

 

 

if this resolves your query do mark it correct n helpful 

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****