Is getRecord() a deprecated method?

Eric K3
Kilo Guru

I have some customized code from a legacy business rule:

gs.getUser().getRecord().getValue('u_dept')

The only documentation I see for getRecord is for returning the current portal context.

Do I need to do a GlideRecord to properly extract data from the user profile? Is getRecord a non-supported way of doing this?

3 REPLIES 3

sachin_namjoshi
Kilo Patron
Kilo Patron

Please use below to extract department for current user

 

gs.getUser().getDepartmentID();

 

Regards,

Sachin

Unfortunately, the field data we need is a custom field. I said u_dept just as an example, but the field could be any custom field like u_xyz or u_whose_idea_was_it_to_add_this_field.

Then, you will have to do GlideRecord to find department for user since it's custom field.

 

Regards,

Sachin