Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I am trying to write a script in the record producer to achieve the following:
new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);
a) Set the short description as Rückkehrer - <name of the subject person>
Note: subject person is set as the value from a reference variable via field mapping
b) Set the opened for as the manager of the subject person
c) Set the value of a custom reference field as the logged in user
I was trying the following but no success. Can someone help:
current.short_description = "Rückkehrer - " + producer.subject_person.name;
current.opened_for = producer.subject_person.manager;
current.u_current_obv = gs.getUser();
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Found the following solution which works for me:
var gr = new GlideRecord('sys_user');
gr.get(producer.sds_onb_subject_person);
if(gr.manager){
current.opened_for = gr.manager;
}
current.short_description = "Rückkehrer - " + gr.name;
current.u_current_obv = gs.getUserID();
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Part c) I was able to solve myself correcting it to:
current.u_current_obv = gs.getUserID();
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Found the following solution which works for me:
var gr = new GlideRecord('sys_user');
gr.get(producer.sds_onb_subject_person);
if(gr.manager){
current.opened_for = gr.manager;
}
current.short_description = "Rückkehrer - " + gr.name;
current.u_current_obv = gs.getUserID();