Reuse same record producer for multiple HR Services

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2021 01:24 PM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2021 08:54 AM
I understand we can, but how do we control which one is submitted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2021 09:57 PM
You have this table which will tell which target record got created because of which record producer
sc_item_produced_record
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 11:06 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2021 06:59 PM
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).