Promoting a Field

Andrew Bettcher
Kilo Sage

Hi,

I was asked to make some updates to the project and project task forms in order for them to receive data from an external source. One of the new fields is a string field that takes the external reference number. I created it individually directly on each table in turn (i.e. so that there are separate fields on both the pm_project and pm_project_task tables with the same name).

These fields are then populated via the import and process I have running. That all works fine.

HOWEVER, I now need to report on time cards submitted against these tasks and include that external reference field. The only place I can see the external field is under Top Task and then scrolling down to the extended fields shown in red on the list:

find_real_file.png

Adding either of these to the report returns no data even though I have confirmed that the field is populated on the forms.

In order to resolve this, I tried to promote the field to the task table using SNGurus amazing guide (here) but that doesn't work. I've tried a few variations on this theme but I haven't been able to successfully promote the table. My background script is:

GlideDBUtil.promoteColumn('pm_project_task', 'planned_task', 'u_netsuite_project_number', true);

But I've also tried moving it to 'task' and also followed some of the recommendations in the comments section underneath.

I guess the question is, does anyone know what would stop a column from being promoted in this way OR, is there another way to get the right field into my report without having to move the column?

5 REPLIES 5

Andrew Bettcher
Kilo Sage

Weird but navigating through the dot walking for Task(task) and TopTask and then adding every version of the field to a report revealed the one of them does actually show the data I need.

I'm not sure why it would and, why it would alone show the data but it does.

The only question then is, why didn't my field promotion work?

Hitesh Patel3
Tera Contributor

Though - it might be useful for you. Starting with London release, promoteColumn() method no longer works in ServiceNow and has been blacklisted. Please find the article below:

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

It says 'A method would be blacklisted if its found to have any security issues or its use can have adverse effects on the instance'.  Is there more information on this? Our account is scoping out this method as a possible solution. 

Joe72
Tera Contributor

It still works as of now. Would highly recommend testing it though to see that it works correctly.