Is getRecord() a deprecated method?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 01:07 PM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 01:40 PM
Please use below to extract department for current user
gs.getUser().getDepartmentID();
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 01:56 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 02:44 PM
Then, you will have to do GlideRecord to find department for user since it's custom field.
Regards,
Sachin