script is not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 10:30 PM
Hi All,
This script is not wokring and i am written in Human resource core scope:
var shrt_desc = current.short_description;
var lastwords = shrt_desc.trim().split(/\s+/);
var ab = lastwords[lastwords.length - 1];
var cd= ab.toString();
// gs.info('test_123'+cd);
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('user_name',cd);
gr.query();
if(gr.next()){
gs.info('test_123'+gr.user);
}
info message giveing undefined.
Can anyone help me
Thanks ,
Chandan
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:30 PM
Hi @chandan31
If // gs.info('test_123'+cd); this line is giving you the desired output for variable cd, then you should check if you are using the correct field name in this line gs.info('test_123'+gr.user);
Check if the backend name of the field is "user".
Thanks