Skip to content

$p.apiBulkDelete

Overview

This script function allows you to bulk delete records using an Ajax POST request.

Syntax

JavaScript
$p.apiBulkDelete({
    id: <Site ID>,
    data: {
        <Data>
    },
    async: <Whether to run asynchronously>,
    done: <Processing when API communication succeeds>,
    fail: <Processing when API communication fails>,
    always: <Processing when API communication completes>
});

Parameters

Parameter Name Type Required Description
Site ID long ○ Site ID of the table in which the records to be deleted are registered.
Data object ○ Specify the conditions of the records to be bulk deleted in JSON format. For the JSON specification, refer to "Settings" in Bulk Delete Records API. GridCheck can also be specified as a feature unique to this script.
Whether to run asynchronously bool Specify false to run as a synchronous process. If omitted, it is true (asynchronous process).
Processing when API communication succeeds function ○ Processing to run when API communication succeeds.
Processing when API communication fails function Processing to run when API communication fails.
Processing when API communication completes function Processing to run when API communication completes.

When GridCheck Is Specified for the Data

Deletes the records checked on the list screen. For details, refer to usage examples 4 and 5.

Usage Examples

1. When deleting records by filtering by column conditions

JavaScript
$p.apiBulkDelete({
    id: 123,
    data: {
        View: {
            ColumnFilterHash: {
                Status: "[100,910]"
            }
        }
    },
    done: function (data) {
        console.log(data);
    },
    fail: function (data) {
        console.log(data);
    },
    always: function (data) {
        console.log(data);
    }
});

2. When deleting multiple specified records (deleting records with record IDs 135,376)

JavaScript
$p.apiBulkDelete({
    id: 123,
    data: {
        Selected: [
            135,
            376
        ]
    },
    done: function (data) {
        console.log(data);
    },
    fail: function (data) {
        console.log(data);
    },
    always: function (data) {
        console.log(data);
    }
});

3. When deleting all records in the target table

JavaScript
$p.apiBulkDelete({
    id: 123,
    data: {
        All: true
    },
    done: function (data) {
        console.log(data);
    },
    fail: function (data) {
        console.log(data);
    },
    always: function (data) {
        console.log(data);
    }
});

4. When deleting records checked on the list screen

JavaScript
$p.apiBulkDelete({
    id: 123,
    data: {
        GridCheck: true
    },
    done: function (data) {
        console.log(data);
    },
    fail: function (data) {
        console.log(data);
    },
    always: function (data) {
        console.log(data);
    }
});

5. When physically deleting records checked on the list screen

JavaScript
$p.apiBulkDelete({
    id: 123,
    data: {
        GridCheck: true,
        PhysicalDelete: true
    },
    done: function (data) {
        console.log(data);
    },
    fail: function (data) {
        console.log(data);
    },
    always: function (data) {
        console.log(data);
    }
});