Class: Tooling

Tooling

new Tooling(conn)

API class for Tooling API call
Parameters:
Name Type Description
conn Connection Connection
Source:

Methods

completions(typeopt, callbackopt) → {Promise.<Tooling~CompletionsResult>}

Retrieves available code completions of the referenced type
Parameters:
Name Type Attributes Description
type String <optional>
completion type (default 'apex')
callback Callback.<Tooling~CompletionsResult> <optional>
Callback function
Source:
Returns:
Type
Promise.<Tooling~CompletionsResult>

create(type, records, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Create records
Parameters:
Name Type Attributes Description
type String SObject Type
records Record | Array.<Record> A record or array of records to create
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

del(type, ids, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Synonym of Tooling#destroy()
Parameters:
Name Type Attributes Description
type String SObject Type
ids String | Array.<String> A ID or array of IDs to delete
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

delete(type, ids, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Synonym of Tooling#destroy()
Parameters:
Name Type Attributes Description
type String SObject Type
ids String | Array.<String> A ID or array of IDs to delete
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

describe(type, callbackopt) → {Promise.<DescribeSObjectResult>}

Describe SObject metadata
Parameters:
Name Type Attributes Description
type String SObject Type
callback Callback.<DescribeSObjectResult> <optional>
Callback function
Source:
Returns:
Type
Promise.<DescribeSObjectResult>

describeGlobal(callbackopt) → {Promise.<DescribeGlobalResult>}

Describe global SObjects
Parameters:
Name Type Attributes Description
callback Callback.<DescribeGlobalResult> <optional>
Callback function
Source:
Returns:
Type
Promise.<DescribeGlobalResult>

describeSObject(type, callbackopt) → {Promise.<DescribeSObjectResult>}

Synonym of Tooling#describe()
Parameters:
Name Type Attributes Description
type String SObject Type
callback Callback.<DescribeSObjectResult> <optional>
Callback function
Source:
Returns:
Type
Promise.<DescribeSObjectResult>

destroy(type, ids, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Delete records
Parameters:
Name Type Attributes Description
type String SObject Type
ids String | Array.<String> A ID or array of IDs to delete
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

executeAnonymous(body, callbackopt) → {Promise.<Tooling~ExecuteAnonymousResult>}

Executes Apex code anonymously
Parameters:
Name Type Attributes Description
body String Anonymous Apex code
callback Callback.<Tooling~ExecuteAnonymousResult> <optional>
Callback function
Source:
Returns:
Type
Promise.<Tooling~ExecuteAnonymousResult>

(protected) initialize()

Initialize tooling API
Source:

insert(type, records, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Synonym of Tooling#create()
Parameters:
Name Type Attributes Description
type String SObject Type
records Object | Array.<Object> A record or array of records to create
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

query(locator, callbackopt) → {Query.<QueryResult>}

Query next record set by using query locator
Parameters:
Name Type Attributes Description
locator String Next record set locator
callback Callback.<QueryResult> <optional>
Callback function
Source:
Returns:
Type
Query.<QueryResult>

queryMore(type, ids, callbackopt) → {Promise.<(Record|Array.<Record>)>}

Retrieve specified records
Parameters:
Name Type Attributes Description
type String SObject Type
ids String | Array.<String> A record ID or array of record IDs
callback Callback.<(Record|Array.<Record>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(Record|Array.<Record>)>

runTestsAsynchronous(classids, callbackopt) → {Promise.<Tooling~ExecuteAnonymousResult>}

Executes Apex tests asynchronously
Parameters:
Name Type Attributes Description
classids Array.<String> Comma separated list of class IDs
callback Callback.<Tooling~ExecuteAnonymousResult> <optional>
Callback function
Source:
Returns:
Type
Promise.<Tooling~ExecuteAnonymousResult>

sobject(type) → {SObject}

Get SObject instance
Parameters:
Name Type Description
type String SObject Type
Source:
Returns:
Type
SObject

update(type, records, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Update records
Parameters:
Name Type Attributes Description
type String SObject Type
records Record | Array.<Record> A record or array of records to update
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

upsert(type, records, extIdField, callbackopt) → {Promise.<(RecordResult|Array.<RecordResult>)>}

Upsert records
Parameters:
Name Type Attributes Description
type String SObject Type
records Record | Array.<Record> Record or array of records to upsert
extIdField String External ID field name
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

Type Definitions

CompletionsResult

Type:
  • Object
Properties:
Name Type Description
publicDeclarations Object
Source:

ExecuteAnonymousResult

Type:
  • Object
Properties:
Name Type Description
compiled Boolean Flag if the query is compiled successfully
compileProblem String Error reason in compilation
success Boolean Flag if the code is executed successfully
line Number Line number for the error
column Number Column number for the error
exceptionMessage String Exception message
exceptionStackTrace String Exception stack trace
Source: