How to get Old Field Values that have been hidden for the projects which once had old field values?

Angie15
Tera Contributor

I am working a project table. Project has a field 'X' which had field values. These Values were hidden and New Values were in place. Now Most of the old values are not present in the list view or form for the projects. How do you bring them back in those projects?

3 REPLIES 3

Shane J
Tera Guru

Have the fields containing the old values been inactivated, or just hidden?

 

If you go to the form view of a record, and click the 'hamburger' on the upper right, can you see the 'missing' fields and values in the XML?  

ShaneJ_0-1701462878128.png

 

Angie15
Tera Contributor

I am able to see the old values but I am not sure how to bulk update the old values to new values as the old values are only visible in audit.

 

Well it would be a GlideRecord query, but I have no idea what table you're talking about or the field names.

 

As long as the fields are valued, you can get the name form the XML too, and fill in the blanks below:

 

var changeRec = new GlideRecord('mystery_project_table_name');

changeRec.addEncodedQuery("mystery_query_for_the_records_you_want_to_update"); //get from a List query 

changeRec.query();

while (changeRec.next()){

changeRec.old_field = changeRec.new_field;

changeRec.update();

}