- 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-26-2022 04:16 AM
it's working now
thanks Mohith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 04:20 AM
Hi Mohith,
What will happen, if the category is changed post insert. How to handle the checklist in this case. What I have found so far is that, it is possible only during insert. Do you know any way where checklist changes based on changes in category or some other field on update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 05:01 AM
Instead of a BR, I created a Flow to create these checklists with the help of HR Task Template records to store the various checklists I need. In that Flow I have a Decision table to retrieve the correct template based on a matching criteria. I create a new custom checklist associated to the case and then I use a Lookup Records action to gather the Checklist Items within that template. I can use that lookup results in a For each loop to create a new checklist items to associate back to the case. The Flow runs on insert but waits until the state changes to WIP before proceeding. You could update this process to run on update in any case where you want to remove a checklist and apply another one.