query.delete(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Deletes an existing query.

Use this method to delete a query definition that was previously created using the SuiteAnalytics Workbook UI. After the query is deleted, it is no longer available and cannot be modified or executed.

Important:

The N/query module lets you create and run queries using the SuiteAnalytics Workbook query engine. You can use the N/query module to load and delete existing queries, but you cannot save queries. You can save queries using the SuiteAnalytics Workbook interface. For more information, see Navigating SuiteAnalytics Workbook.

Returns

void

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

5 units

Module

N/query Module

Sibling Module Members

N/query Module Members

Since

2018.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.id

string

required

The script ID of the query to delete.

Errors

Error Code

Thrown If

UNABLE_TO_DELETE_QUERY

A query with the specified ID cannot be deleted because the query does not exist or you do not have permission to delete it.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.

            // Add additional code
...
query.delete({ id: 'custworkbook237'
});
...
// Add additional code 

          

Related Topics

N/query Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices