- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 01:49 AM
Ex-
There is a "create a HR case" record producer.when I will raise a request with category value is A then 2 checklist testA1 and testA2 will display in the HR case.
if I will raise a request with Category value is B then 2 checklist testB1 and testB2 will display in the HR case
Category is lookup selectbox and this field values are dependent on another field lookup selectbox ie what is this request regarding
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 01:02 AM
Hello
then lets try this we have two tables where check lists and check list items are stored .
1) Check list - where your check list can be created manually .
back end name -checklist.LIST
2) Checklist Item - where check list items are stored
back end name :checklist_item.LIST
So you can write an after insert BR on hr case table and get the category through script and check if its category A insert a record in checklist table and under that record again insert check list items through script with exact mappings .
Main thing is you need to map document ID field which stores the HR case sys_id.If you try to map it then automatically the check list will be inserted
sample script
var gr= new GlideRecord('checklist');
gr.initialize();
gr.document=current.sys_id;
gr.owner =gs.getUserID();
gr.table="sn_hr_core_case";
var checkid = gr.insert();
var arr=['test1' ,'test2']; // store your check list item names
var orderCount=0;
for(var i=0; i<arr.length; i++)
{
var chck = new GlideRecord('checklist_item');
chck.initialize();
chck.checklist=checkid;
chck.name=arr[i];
chck.order=orderCount++;
chck.insert();
}
Not sure if it will work but worth giving a try .
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 10:03 PM
Hello
Could you please look into this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 11:21 PM
Hello
you can do one thing.
1) Create two HR SERVICES and tag this record producer to both HR services but with different categories
Tag that record producer to an HR service like below .
In first HR service give category A and in second hr service give Category b and tag your create HR case record producer to it in record producer field highlighted in below picture.
Then create your Check list accordingly using checklist section in the HR service(marked in blac in below screenshot)
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 12:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 01:02 AM
Hello
then lets try this we have two tables where check lists and check list items are stored .
1) Check list - where your check list can be created manually .
back end name -checklist.LIST
2) Checklist Item - where check list items are stored
back end name :checklist_item.LIST
So you can write an after insert BR on hr case table and get the category through script and check if its category A insert a record in checklist table and under that record again insert check list items through script with exact mappings .
Main thing is you need to map document ID field which stores the HR case sys_id.If you try to map it then automatically the check list will be inserted
sample script
var gr= new GlideRecord('checklist');
gr.initialize();
gr.document=current.sys_id;
gr.owner =gs.getUserID();
gr.table="sn_hr_core_case";
var checkid = gr.insert();
var arr=['test1' ,'test2']; // store your check list item names
var orderCount=0;
for(var i=0; i<arr.length; i++)
{
var chck = new GlideRecord('checklist_item');
chck.initialize();
chck.checklist=checkid;
chck.name=arr[i];
chck.order=orderCount++;
chck.insert();
}
Not sure if it will work but worth giving a try .
Please mark my answer correct if it helps you