- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 01:45 PM
Hello Everyone,
is something wrong with my script :
var visa ;
var g = new GlideRecord('sn_hr_core_profile');
g.addQuery('number=HRP0153690');
g.query();
if (g.next){
visa = g.getDisplayValue('u_employment_status');
gs.print("Print Visa value "+ visa);
}
Struck with simple query. Any help please ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 02:38 PM - edited 11-23-2022 07:38 PM
String fields do not have display values. Use getValue instead
visa = g.getValue('u_employment_status');
also in line 5, you are missing ()
g.next()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 11:22 PM
Hi @kuttti ,
Use below script :-
var visa ;
var g = new GlideRecord('sn_hr_core_profile');
g.addEncodedQuery('number=HRP0153690');
g.query();
if (g.next()){
visa = g.getDisplayValue('u_employment_status');
gs.print("Print Visa value "+ visa);
}