How to update HR profile of the requested for person of a HR case using the record producer

Rutusha
Tera Contributor

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

3 REPLIES 3

manjusha_
Kilo Sage

@Rutusha 

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

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

 

 

 

@Rutusha 

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