Reuse same record producer for multiple HR Services

Nitesh Balusu
Giga Guru

Hello!

Is there a way we can create multiple HR services and just use one record producer for several services, for example let's say the questions asked to the employee in the record producer are the same for payroll inquiry and payroll issue. Can we create just one record producer for both services and have a drop down in the record producer form for the employee to pick what their question is and then direct the HR Case to the service based on what the employee picks in the drop down?

 

8 REPLIES 8

I understand we can, but how do we control which one is submitted?

@Nitesh Balusu 

You have this table which will tell which target record got created because of which record producer

sc_item_produced_record

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello @Ankur Bawiskar ,

I attempted to link the same record producer to a second HR service that I created, but I encountered an error, as depicted in the screenshot provided.

hema26_0-1733209533397.png

 

Ronald Lob1
Tera Guru

In the Script portion of your Record Producer, the system will default it to something like:

 

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);

 

This will log a Case under the Service linked to the producer as normal. You can change this to:

 

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducerByService(producer, <<SERVICE>>, cat_item.sys_id); 

 

This allows you to specify the Service sys_id to be used. The service needs to apply to the same table as the Record Producer (or maybe a parent ... not really sure).