Newer Version Available

This content describes an older version of this product. View Latest

Promotion.Record

This APEX class provides a wrapper to Promotion SObject Records. Each instance wraps an SObject Record related to the parent TPM_Promotion and provide methods to manipulate them in order to flag them for insertion or deletion. It also provides methods to extract the underlying SObject records so updates can be made.

Namespace

Example Implementation

TPM_Promotion.Record Methods

The following are methods for TPM_Promotion.Record.

global Boolean isDeleted

Indicates if the record is flagged for deletion or if it will be updated during save.

API Version

55

Signature

global Boolean isDeleted()

global Boolean isNew

Indicates if the record is new or already exists in the database.

API Version

55

Signature

global Boolean isNew()

global Id getId

Returns the temporary id for the wrapped record. Promotion save process uses temporary id’s for records that are not still committed to the database.

API Version

55

Signature

global Id getId()

global SObject getOriginalRecord

Returns the original SObject record as stored in the database. If the record is new, this method returns null.

API Version

55

Signature

global SObject getOriginalRecord()

global SObject getRecord

Returns the wrapped SObject record. The returned record field values can be updated.

API Version

55

Signature

global SObject getRecord()

Example

global void setFields

Sets the fields passed in the map as fields for the wrapped SObject record. The IsNew and IsDeleted fields will map to the is New() and is Deleted() methods. If a key in the map is not an SObject field, it will be ignored.

API Version

55

Signature

global void setFields(Map<String, Object> fieldValues)

Example

global void setIsDeleted

Sets the record to be deleted or to update the existing one.

API Version

55

Signature

global void setIsDeleted(Boolean value)

global void setIsNew

Sets the record to be inserted as a new record or to update the existing one.

API Version

55

Signature

global void setIsNew(Boolean value)