Make checklist mandatory

João V Freitas
Tera Contributor

I am working on a personal project and I want to make checklists mandatory for a specific task. I checked some discussions in the community and came across a reply teaching a way to do it. (Solved: Checklist - Able to Make Mandatory and Able to App... - ServiceNow Community). But this method only let the record be updated in any way if all the boxes are checked off.
I want a way to make the all check boxes to be checked off as mandatory, I want to be able to check off the box that was completed and update the task, rather than having it say all check boxes need to be checked off before updating. So basically the end goal is to still be able to update the task and check off the items that are completed, but make it mandatory all boxes are checked off before closing the task.
Any advice on how to accomplish this?

1 ACCEPTED SOLUTION

Chaitanya ILCR
Kilo Patron

Hi @João V Freitas ,

create a Before update BR on your table

with condition like (state changes to closed) or (active Changes to False)

whatever is meaningful

ChaitanyaILCR_0-1752599565786.png

 

with script

ChaitanyaILCR_1-1752599642665.png

(function executeRule(current, previous /*null when async*/ ) {

    var gr = new GlideRecord("checklist_item");
    gr.addEncodedQuery('complete=false^checklist.document=' + current.getValue('sys_id'));
    gr.query();
    if (gr.hasNext()) {
        gs.addErrorMessage('close the active check lists');
        current.setAbortAction(true);
    }


})(current, previous);

I have taken problem table as an example but update it with you table name and add condition with above script

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

View solution in original post

7 REPLIES 7

GlideFather
Tera Patron

Olá @João V Freitas 

please provide more details about the checkboxes and how do you want to update them.

 

Then you can use client script, business rule, UI Policy (Action), Flow designer... according to the exact scenario. 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Olá KamilT,

Eu já consegui achar solução para o problema.
Mas muito obrigado pela resposta!

I already found a solution for my issue.

But thanks for the reply!

Perfeito, obrigado por informar-me e muito parabéns 🥳

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */