Delete Records

Table of Contents

Overview

This JS API task deletes the records displayed by a report of your Zoho Creator application. It is deleted from the stored form and hence will not be available anywhere in the application. The delete request is subject to custom validations configured for the target form. The maximum of 200 records can be deleted for every API call. If exceeded, and you will receive an error.

This task is based on the Delete Records  REST API V2. Learn more about understanding the response

Request Details

Syntax

ZOHO.CREATOR.API.deleteRecord(config).then(function(response){
   //callback block
});

Syntax Details

The syntax holds:

  • <config> (object) - The configuration required to delete records in a report. This configuration includes the following parameters.
NameTypeDescription
appName
(Optional)
string

Link name of the application in which records need to be deleted. Retrieve the link name using the Creator report's URL: https://creatorapp.zoho.com/<accountName>/<appName>/#Report:<reportName>

Note: This parameter only needs to be passed when you need to delete records in other applications of the same Creator account. When not specified, records will be deleted from the current application.
reportNamestringLink name of the report in which the records need to be deleted. Retrieve the link name using the Creator report's URL: https://creatorapp.zoho.com/<accountName>/<appName>/#Report:<reportName>
criteriastringThe criteria using which you want to filter the target report. If all records of a report need to be deleted, include "criteria": "ID!=0" or "criteria": "ID!=null" in your request. Criteria is mandated to prevent accidental deletion of all records.

Possible Errors

Refer to this page for the complete list of error codes and messages.

Sample Input

Copiedvar config = { 
       appName : "zylker"
       reportName : "All-Timesheet", 
       criteria : "(Status == \"Invalid\" && Date '01-01-2019')"
}
ZOHO.CREATOR.API.deleteRecord(config).then(function(response){
    console.log("Record has been deleted");
});

Sample Response

Copiedresponse = {
    "result": [{
        "code": 3000,
        "data": {
            "ID": "66359000000021016"
          },
        "message": "success"
       },
       {
       "code": 3000,
       "data": {
           "ID": "66359000000024309"
         },
       "message": "success"
      }
    ],
    "code": 3000
}