want to take employee start date from HR profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2022 01:15 PM
Hi All,
I take employeement start date from HR profile and set the value in sn_hr_core_case table.
I have wrote code . After/update on case table but it is not working. Please look into this.
(function executeRule(current, previous /*null when async*/) {
// var basecurrency = current.u_currency;
// var split1 = basecurrency.split(' ').slice(0, 1).join(' ');
// gs.addInfoMessage("Check done:" +split1);
gs.addInfoMessage("hello world test");
var ga1 = new GlideRecord("sn_hr_core_profile");
ga1.addQuery("user",name);
ga1.query();
if(ga1.next())
{
current.u_itpend_date=ga1.employment_start_date;
current.update();
}
gs.info("hiiiiiiiiiiiiiiiiii");
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 10:31 AM
Hi,
var ga1 = new GlideRecord("sn_hr_core_profile");
ga1.addQuery("user",current.opened_for);
ga1.query();
if(ga1.next()){
Change 2nd line in your to current.opened_for
Try let me know
Thanks
Viswa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 01:07 PM
hellp
absnow
Mohith Devatte
• 3h ago3 hours ago Author
Hi Mohith,
I reruire opened for user employement date not current login user. It is not working.
(function executeRule(current, previous /*null when async*/) {
gs.addInfoMessage("hello world");
var ga1 = new GlideRecord("sn_hr_core_profile");
ga1.addQuery("user",current.opened_for);
ga1.query();
if(ga1.next())
{
var gr = new GlideRecord('sn_hr_core_case_global_mobility');
gr.addQuery('sys_id',current.sys_id);
gr.query();
if(gr.next())
{
gr.u_itpend_date=ga1.employment_start_date;
gr.update();
}
}
gs.addInfoMessage("hello world");
})(current, previous);
mark the answer correct if this helps you