Class: SObject

SObject

new SObject()

A class for organizing all SObject access
Source:

Methods

approvalLayouts(callbackopt) → {Promise.<ApprovalLayoutInfo>}

Describe compact layout information defined for SObject
Parameters:
Name Type Attributes Description
callback Callback.<ApprovalLayoutInfo> <optional>
Callback function
Source:
Returns:
Type
Promise.<ApprovalLayoutInfo>

bulkload(operation, optionsopt, inputopt, callbackopt) → {Bulk~Batch}

Call Bulk#load() to execute bulkload, returning batch object
Parameters:
Name Type Attributes Description
operation String Bulk load operation ('insert', 'update', 'upsert', 'delete', or 'hardDelete')
options Object <optional>
Options for bulk loading operation
Properties
Name Type Attributes Description
extIdField String <optional>
External ID field name (used when upsert operation).
input Array.<Record> | stream.Stream | String <optional>
Input source for bulkload. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

compactLayouts(callbackopt) → {Promise.<CompactLayoutInfo>}

Describe compact layout information defined for SObject
Parameters:
Name Type Attributes Description
callback Callback.<CompactLayoutInfo> <optional>
Callback function
Source:
Returns:
Type
Promise.<CompactLayoutInfo>

count(conditionsopt, callbackopt) → {Query.<Number>}

Count num of records which matches given conditions
Parameters:
Name Type Attributes Description
conditions Object | String <optional>
Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
callback Callback.<Number> <optional>
Callback function
Source:
Returns:
Type
Query.<Number>

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

Create records
Parameters:
Name Type Attributes Description
records Record | Array.<Record> A record or array of records to create
options Object <optional>
Options for rest api.
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

createBulk(inputopt, callbackopt) → {Bulk~Batch}

Bulkly insert input data using bulk API
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk insert. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

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

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

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

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

deleteBulk(inputopt, callbackopt) → {Bulk~Batch}

Synonym of SObject#destroyBulk()
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

deleted(start, end, callbackopt) → {Promise.<DeletedRecordsInfo>}

Retrieve the deleted records
Parameters:
Name Type Attributes Description
start String | Date start date or string representing the start of the interval
end String | Date start date or string representing the end of the interval, must be > start
callback Callback.<DeletedRecordsInfo> <optional>
Callback function
Source:
Returns:
Type
Promise.<DeletedRecordsInfo>

deleteHardBulk(inputopt, callbackopt) → {Bulk~Batch}

Synonym of SObject#destroyHardBulk()
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

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

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

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

Delete records
Parameters:
Name Type Attributes Description
ids String | Array.<String> A ID or array of IDs to delete
options Object <optional>
Options for rest api.
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

destroyBulk(inputopt, callbackopt) → {Bulk~Batch}

Bulkly delete records specified by input data using bulk API
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

destroyHardBulk(inputopt, callbackopt) → {Bulk~Batch}

Bulkly hard delete records specified in input data using bulk API
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

find(conditionsopt, fieldsopt, optionsopt, callbackopt) → {Query.<Array.<Record>>}

Find and fetch records which matches given conditions
Parameters:
Name Type Attributes Description
conditions Object | String <optional>
Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
fields Object | Array.<String> | String <optional>
Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
options Object <optional>
Query options.
Properties
Name Type Attributes Description
limit Number <optional>
Maximum number of records the query will return.
offset Number <optional>
Offset number where begins returning results.
skip Number <optional>
Synonym of options.offset.
callback Callback.<Array.<Record>> <optional>
Callback function
Source:
Returns:
Type
Query.<Array.<Record>>

findOne(conditionsopt, fieldsopt, optionsopt, callbackopt) → {Query.<Record>}

Fetch one record which matches given conditions
Parameters:
Name Type Attributes Description
conditions Object | String <optional>
Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
fields Object | Array.<String> | String <optional>
Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
options Object <optional>
Query options.
Properties
Name Type Attributes Description
limit Number <optional>
Maximum number of records the query will return.
offset Number <optional>
Offset number where begins returning results.
skip Number <optional>
Synonym of options.offset.
callback Callback.<Record> <optional>
Callback function
Source:
Returns:
Type
Query.<Record>

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

Synonym of SObject#create()
Parameters:
Name Type Attributes Description
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>)>

insertBulk(inputopt, callbackopt) → {Bulk~Batch}

Synonym of SObject#createBulk()
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk insert. Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

layouts(layoutNameopt, callbackopt) → {Promise.<LayoutInfo>}

Describe layout information for SObject
Parameters:
Name Type Attributes Description
layoutName String <optional>
Name of named layout. (e.g. UserAlt in User SObject)
callback Callback.<LayoutInfo> <optional>
Callback function
Source:
Returns:
Type
Promise.<LayoutInfo>

listview(id) → {ListView}

Returns the list view info in specifed view id
Parameters:
Name Type Description
id String List view ID
Source:
Returns:
Type
ListView

listviews(callbackopt) → {Promise.<ListViewsInfo>}

Returns the list of list views for the SObject
Parameters:
Name Type Attributes Description
callback Callback.<ListViewsInfo> <optional>
Callback function
Source:
Returns:
Type
Promise.<ListViewsInfo>

quickAction(actionName) → {QuickAction}

Get reference for specified quick aciton in the SObject
Parameters:
Name Type Description
actionName String Name of the quick action
Source:
Returns:
Type
QuickAction

quickActions(callbackopt) → {Promise.<Array.<QuickAction~QuickActionInfo>>}

Returns all registered quick actions for the SObject
Parameters:
Name Type Attributes Description
callback Callback.<Array.<QuickAction~QuickActionInfo>> <optional>
Callback function
Source:
Returns:
Type
Promise.<Array.<QuickAction~QuickActionInfo>>

recent(callbackopt) → {Promise.<Array.<RecordResult>>}

Retrieve recently accessed records
Parameters:
Name Type Attributes Description
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Promise.<Array.<RecordResult>>

record(id) → {RecordReference}

Get record representation instance by given id
Parameters:
Name Type Description
id String A record ID
Source:
Returns:
Type
RecordReference

retrieve(ids, optionsopt, callbackopt) → {Promise.<(Record|Array.<Record>)>}

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

select(fieldsopt, callbackopt) → {Query.<Array.<Record>>}

Find and fetch records only by specifying fields to fetch.
Parameters:
Name Type Attributes Description
fields Object | Array.<String> | String <optional>
Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
callback Callback.<Array.<Record>> <optional>
Callback function
Source:
Returns:
Type
Query.<Array.<Record>>

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

Update records
Parameters:
Name Type Attributes Description
records Record | Array.<Record> A record or array of records to update
options Object <optional>
Options for rest api.
callback Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function
Source:
Returns:
Type
Promise.<(RecordResult|Array.<RecordResult>)>

updateBulk(inputopt, callbackopt) → {Bulk~Batch}

Bulkly update records by input data using bulk API
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk update Accepts array of records, CSv string, and CSV data input stream.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch

updated(start, end, callbackopt) → {Promise.<UpdatedRecordsInfo>}

Retrieve the updated records
Parameters:
Name Type Attributes Description
start String | Date start date or string representing the start of the interval
end String | Date start date or string representing the end of the interval, must be > start
callback Callback.<UpdatedRecordsInfo> <optional>
Callback function
Source:
Returns:
Type
Promise.<UpdatedRecordsInfo>

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

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

upsertBulk(inputopt, callbackopt) → {Bulk~Batch}

Bulkly upsert records by input data using bulk API
Parameters:
Name Type Attributes Description
input Array.<Record> | stream.Stream | String <optional>
Input source for bulk upsert. Accepts array of records, CSv string, and CSV data input stream.
options.extIdField String <optional>
External ID field name
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Source:
Returns:
Type
Bulk~Batch