How to update HR profile of the requested for person of a HR case using the record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 05:23 AM
Hi All,
I have a requirement where I need to update the HR profile of a requested person of the record producer .
I have a record producer to submit this request when i select the requested person then all the personal details from HR profile table get populated on the record producer variables.
When I submit this record producer then HR case is created then the associated HR profile for the requested person should get updated with the producer variables .
Could some one please help me here.
Regards,
Rutuja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 05:34 AM
You can update Hr profile using after insert business rule-
var hrHr = new GlideRecord('hr_profile_table_name'){
hrHr.addQuery('user_field_name_in_hr_profile',current.user_field);
hrHr.query();
if(hrHr.next()){
update user hr profile field values here
}
}
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 06:20 AM
Hi Manjusha,
Could you plz let me know how to update hr profile field values because as per my knowledge we cannot use producer.RecordProducerFieldvalue in BR.
Regards,
Rutuja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 12:12 AM
You can directly update user hr profile from record producer script as below code
var hrHr = new GlideRecord('sn_hr_core_profile'){//add correct hr profile name
hrHr.addQuery('user',producer.user_field_name);
hrHr.query();
if(hrHr.next()){
hrHr.date_of_birth = producer. date_of_birth_field_name;
update others fields as date of birth
}
}
But let me know ,what is the purpose of the hr case ,just to update hr profile or anything else
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact
Thanks,
Manjusha Bangale