How to promote out of the box field from Child to Parent table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 01:13 PM
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.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 01:17 PM
Did you happen to see the workaround options mentioned in the referenced KB article?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 01:19 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 01:44 PM
Please mark Michael Ritchie's reply as Correct. Even if it works, it is a bad idea to promote an out-of-box field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 01:53 PM
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