The CreatorCon Call for Content is officially open! Get started here.

How to get value from Inactive fields from an active table

R_52
Tera Guru

I have field which has been made Inactive recently. Now, I am trying to get the value stored from the Inactive field. 

I could not get the value using scripting. I have tried gliding the record 

 

var gr = new GlideRecord('table');

gr.query();

while ( gr.next()) {

  gr.getValue('Inactive field');  // This way not working.

  OR

  gr.Inactive_field;  // This way also not working.

}

 

I can see the value is there, when I did the "Show XML" of the record.

Please let me know if anyone has information on this.

2 REPLIES 2

sushantmalsure
Mega Sage

well it worked for me.

I have tried this on user table where last_login_device field in active=false

eg:

var geti = new GlideRecord('sys_user');
geti.addQuery('sys_id','<user_sys_id>');
geti.query();
if(geti.next()){
gs.print('inside '+geti.active);
gs.print(geti.last_login_device);
}

I think you are missing to add addQuery() where you need to specify which records inactive field you want to see

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Above syntax is just an example one.. I have added the addQuery condition.