DML
DML
DML interface describes the supported database operations. The allOrNone parameter specifies whether the operation allows partial success. If you specify false for this parameter and a record fails, the remainder of the DML operation can still succeed. Method which use this parameter, returns a result object (DBResult class) that can be used to verify which records succeeded, which failed, and why. If the parameter is set true, an exception is thrown if the method is not successful.
remove(SObject record)
Removes record
Signature:
global virtual void remove(SObject record)
Parameters:
- record - salesforce record.
Return:
Void
remove(SObject record, Boolean all)
Removes record
Signature:
global virtual forvendi.DB.DBResult remove(SObject record, Boolean all)
Parameters:
- record - salesforce record.
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult).
Return:
Returns DBResult operation results based on DML strategy.
remove(SObject[] records)
Removes records
Signature:
global virtual void remove(SObject[] records)
Parameters:
- records - salesforce records.
Return:
Void
remove(Id recordId)
Removes record by id
Signature:
global virtual void remove(Id recordId)
Parameters:
- recordId - salesforce record id.
Return:
Void
remove(Id[] recordId)
Removes record by ids
Signature:
global virtual void remove(Id[] recordId)
Parameters:
- recordId - salesforce record ids.
Return:
Void
remove(Id[] recordIds, Boolean all)
Removes records with selected ids
Signature:
global virtual forvendi.DB.DBResult remove(Id[] recordIds, Boolean all)
Parameters:
- recordIds - salesforce record ids.
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
remove(Set recordIds, Boolean all)
Removes records with selected ids
Signature:
global virtual forvendi.DB.DBResult remove(Set<Id> recordIds, Boolean all)
Parameters:
- recordIds - salesforce record ids.
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
remove(SObject[] records, Boolean all)
Removes records with selected ids
Signature:
global virtual forvendi.DB.DBResult remove(SObject[] records, Boolean all)
Parameters:
- records - salesforce records.
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
removeAsync(SObject record)
Removes record of External Object
Signature:
global virtual forvendi.DB.DBResult removeAsync(SObject record)
Parameters:
- records - salesforce record
Return:
Returns DBResult operation results based on DML strategy.
removeAsync(SObject[] records)
Removes records of External Object
Signature:
global virtual forvendi.DB.DBResult removeAsync(SObject[] records)
Parameters:
- records - salesforce records
Return:
Returns DBResult operation results based on DML strategy.
hardRemove(SObject record)
Removes record.
Signature:
global virtual void hardRemove(SObject record)
Parameters:
- record - salesforce record
Return:
Void
hardRemove(SObject record, Boolean all)
Removes record and cleanups recycle bin.
Signature:
global virtual forvendi.DB.DBResult hardRemove(SObject record, Boolean all)
Parameters:
- record - salesforce record
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return: Returns DBResult operation results based on DML strategy.
hardRemove(SObject[] records)
Removes records and cleanups recycle bin.
Signature:
global virtual void hardRemove(SObject[] records)
Parameters:
- records - salesforce records
Return:
Void
hardRemove(Id recordId)
Removes records by id and cleanups recycle bin.
Signature:
global virtual void hardRemove(Id recordId)
Parameters:
- recordId - salesforce record id
Return:
Void
hardRemove(Id[] recordIds)
Removes records by ids and cleanups recycle bin.
Signature:
global virtual void hardRemove(Id[] recordIds)
Parameters:
- recordIds - salesforce record ids
Return:
Void
hardRemove(Set recordIds)
Removes records by ids and cleanups recycle bin.
Signature:
global virtual void hardRemove(Set<Id> recordIds)
Parameters:
- recordIds - salesforce record ids
Return:
Void
hardRemove(Id[] recordIds, Boolean all)
Removes records with ids and cleanups recycle bin.
Signature:
global virtual forvendi.DB.DBResult hardRemove(Id[] recordIds, Boolean all)
Parameters:
- recordIds - salesforce record ids
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
hardRemove(SObject[] records, Boolean all)
Removes records and cleanups recycle bin.
Signature:
global virtual forvendi.DB.DBResult hardRemove(SObject[] records, Boolean all)
Parameters:
- records - salesforce records
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
create(SObject record)
Creates record.
Signature:
global virtual void create(SObject record)
Parameters:
- record - salesforce record
Return:
Void
create(SObject[] records)
Creates records.
Signature:
global virtual void create(SObject[] records)
Parameters:
- records - salesforce records
Return:
Void
create(SObject[] records, Boolean all)
Creates records.
Signature:
global virtual forvendi.DB.DBResult create(SObject[] records, Boolean all)
Parameters:
- records - salesforce records
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
createAsync(SObject record)
Creates record of External Object.
Signature:
global virtual forvendi.DB.DBResult createAsync(SObject record)
Parameters:
- record - salesforce record
Return:
Returns DBResult operation results.
createAsync(SObject[] records)
Creates records of External Object.
Signature:
global virtual forvendi.DB.DBResult createAsync(SObject[] records)
Parameters:
- records - salesforce records
Return:
Returns DBResult operation results.
modify(SObject record)
Updates record.
Signature:
global virtual void modify(SObject record)
Parameters:
- record - salesforce record
Return:
Void
modify(SObject[] records)
Updates records.
Signature:
global virtual void modify(SObject[] records)
Parameters:
- records - salesforce records
Return:
Void
modify(SObject record, Boolean all)
Updates record.
Signature:
global virtual forvendi.DB.DBResult modify(SObject record, Boolean all)
Parameters:
- record - salesforce record
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
modify(SObject[] records, Boolean all)
Updates records.
Signature:
global virtual forvendi.DB.DBResult modify(SObject[] records, Boolean all)
Parameters:
- records - salesforce records
- all - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
modifyAsync(SObject record)
Updates record of External Object.
Signature:
global virtual forvendi.DB.DBResult modifyAsync(SObject record)
Parameters:
- record - salesforce record
Return:
Returns DBResult operation results.
modifyAsync(SObject[] records)
Updates records of External Object.
Signature:
global virtual forvendi.DB.DBResult modifyAsync(SObject[] records)
Parameters:
- records - salesforce records
Return:
Returns DBResult operation results.
convert(Database.LeadConvert record)
Converts selected record.
Signature:
global virtual void convert(Database.LeadConvert record)
Parameters:
- record - salesforce record
Return:
Void
convert(Database.LeadConvert[] records)
Converts selected records.
Signature:
global virtual void convert(Database.LeadConvert[] records)
Parameters:
- records - salesforce records
Return:
Void
convert(Database.LeadConvert record, Boolean allOrNone)
Converts selected record.
Signature:
global virtual forvendi.DB.DBResult convert(Database.LeadConvert record, Boolean allOrNone)
Parameters:
- record - salesforce record
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
convert(Database.LeadConvert[] records, Boolean allOrNone)
Converts selected records.
Signature:
global virtual forvendi.DB.DBResult convert(Database.LeadConvert[] records, Boolean allOrNone)
Parameters:
- records - salesforce records
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult)
Return:
Returns DBResult operation results based on DML strategy.
send(Messaging.SingleEmailMessage record)
Sends single email message.
Signature:
global virtual void send(Messaging.SingleEmailMessage record)
Parameters:
- record - email message.
Return:
Void
send(Messaging.SingleEmailMessage[] records)
Sends email messages.
Signature:
global virtual void send(Messaging.SingleEmailMessage[] records)
Parameters:
- record - email messages.
Return:
Void
send(Messaging.SingleEmailMessage record, Boolean allOrNone)
Sends single email message.
Signature:
global virtual forvendi.DB.DBResult send(Messaging.SingleEmailMessage record, Boolean allOrNone)
Parameters:
- record - email message.
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult). Return:
Returns DBResult operation results based on DML strategy.
send(Messaging.SingleEmailMessage[] records, Boolean allOrNone)
Sends email messages.
Signature:
global virtual forvendi.DB.DBResult send(Messaging.SingleEmailMessage[] records, Boolean allOrNone)
Parameters:
- records - email messages.
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult). Return:
Returns DBResult operation results based on DML strategy.
publish(SObject event)
Publishes events.
Signature:
global virtual forvendi.DB.DBResult publish(SObject event)
Parameters:
- event - platform event
Return:
Returns DBResult operation results.
publish(SObject[] events)
Publishes events.
Signature:
global virtual forvendi.DB.DBResult publish(SObject[] events)
Parameters:
- events - platform events
Return:
Returns DBResult operation results.
upsertRecords(SObject[] records)
Upserts records.
Signature:
global virtual void upsertRecords(SObject[] records)
Parameters:
- records - salesforce records
Return:
Void
upsertRecord(SObject record, Boolean allOrNone)
Upserts record.
Signature:
global virtual forvendi.DB.DBResult upsertRecord(SObject record, Boolean allOrNone)
Parameters:
- record - salesforce record
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult).
Return:
Returns DBResult operation results.
upsertRecords(SObject[] records, Boolean allOrNone)
Upserts records.
Signature:
global virtual forvendi.DB.DBResult upsertRecords(SObject[] records, Boolean allOrNone)
Parameters:
- records - salesforce records
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult).
Return:
Returns DBResult operation results.
upsertRecords(SObject[] records, SObjectField externalIdField)
Upserts records.
Signature:
global virtual void upsertRecords(SObject[] records, SObjectField externalIdField)
Parameters:
- records - salesforce records
- externalIdField - External Object Id field
Return:
Void
upsertRecord(SObject record, SObjectField externalIdField, Boolean allOrNone)
Upserts record.
Signature:
global virtual forvendi.DB.DBResult upsertRecords(SObject record, SObjectField externalIdField, Boolean allOrNone)
Parameters:
- record - salesforce record
- externalIdField - External Object Id field
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult).
Return:
Returns DBResult operation results.
upsertRecords(SObject[] records, SObjectField externalIdField, Boolean allOrNone)
Upserts records.
Signature:
global virtual forvendi.DB.DBResult upsertRecords(SObject[] records, SObjectField externalIdField, Boolean allOrNone)
Parameters:
- records - salesforce records
- externalIdField - External Object Id field
- allOrNone - determines DML strategy: true - all or none (throws exception), false - partial success (returns DBResult).
Return:
Returns DBResult operation results.
query(String query, Map<String, Object> bindMap)
SOQL query using dynamically passed bind variables.
Signature:
global virtual SObject[] query(String query, Map<String, Object> bindMap)
Parameters:
- query - SOQL query that includes Apex bind variables preceded by a colon
- bindMap - A map that contains keys for each bind variable specified in the SOQL queryString and its value.
Return:
Returns a List of SObjects.
countQuery(String query, Map<String, Object> bindMap)
Returns number of records that a dynamic SOQL Query would return when executed.
Signature:
global virtual Long countQuery(String query, Map<String, Object> bindMap)
Parameters:
- query - SOQL query that includes Apex bind variables preceded by a colon
- bindMap - A map that contains keys for each bind variable specified in the SOQL queryString and its value.
Return:
Returns a Number.
getQueryLocator(String query)
Creates a QueryLocator object.
Signature:
global virtual Database.QueryLocator getQueryLocator(String query)
Parameters:
- query - SOQL query
Return:
Returns a record set.
getQueryLocator(String query, Map<String, Object> bindMap)
Creates a QueryLocator object using bind variables.
Signature:
global virtual Database.QueryLocator getQueryLocator(String query, Map<String, Object> bindMap)
Parameters:
- query - SOQL query that includes Apex bind variables preceded by a colon.
- bindMap - A map that contains keys for each bind variable specified in the SOQL queryString and its value.
Return:
Returns a record set.
query(String query)
Executes provided query.
Signature:
global virtual SObject[] query(String query)
Parameters:
- query - SOQL query
Return:
Returns a List of SObjects.
countQuery(String query)
Executes provided count query.
Signature:
global virtual Long countQuery(String query)
Parameters:
- query - SOQL query
Return:
Returns a Number.