Check all checkboxes

This sample code checks and unchecks all choices of a checkbox field.

Sample Image


Sample Code

// Check/uncheck all checkbox choices

(function() {
    "use strict";

    var CHECKALL = 'check_all'; // Field code of checkbox to check/uncheck all checkboxes
    var CHECKBOX = 'mycheckbox'; //Field code of checkbox to have all choices checked/unchecked

    var events = ["app.record.create.change." + CHECKALL, "app.record.edit.change." + CHECKALL];, function(event) {
        var record = event.record;
        var changes = event.changes.field.value;

        if (changes[0] === "check all") {
            record[CHECKBOX].value = ["sample1", "sample2", "sample3", "sample4", "sample5"];
        } else {
            record[CHECKBOX].value = [];
        return event;


Make sure to match the Field code your fields, with the Field code written in the code.


Refer to the Tutorial page, on how to add scripts to your app.

Was this article helpful?
0 out of 0 found this helpful
Please sign in to leave a comment.