Newer Version Available

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

RE_Order Class

This Apex class provides programmatic access to the retail order sObject, and its related sObjects.

Namespace

Example Implementation

Supported Methods

getOrder()

Returns the RE_Order.Record instance with the order contents.

API Version
59.0
Signature
global RE_Order.Record getOrder()
Example

getOrderItems()

Returns the List<RE_Order.Record> instances with order items.

API Version
59.0
Signature
global List<RE_Order.Record> getOrderItems()
Example

List<RE_Order.Record> getOrderItems()

Returns filtered List<RE_Order.Record> instances with order items.

API Version
59.0
Signature
global List<RE_Order.Record> getOrderItems(Boolean includeNew, Boolean includeDirty, Boolean includeDeleted)
Example

append(SObject record)

Appends a custom sObject record to the RE_Order instance. When the order object gets saved, this record is inserted, updated, or deleted, depending on the RE_Order.Record instance state.

API Version
59.0
Signature
global RE_Order.Record append(SObject record)
Example

addRelationship(RE_Order.Record child, SObjectField relationField, RE_Order.Record parent)

Notifies the RE_Order instance about a relationship between two records.

Avoid using direct DML manipulations for records that are part of the transactional state of an order. During the order save process, the records provided by the RE_Order instances use temporary IDs for records that aren’t still in the database. Using the methods provided by the RE_Order object ensures that all relationships and IDs are properly resolved before committing.

API Version
59.0
Signature
global void addRelationship(RE_Order.Record child, SObjectField relationField, RE_Order.Record parent)
Example

registerWork(DoWork work)

Adds work to be executed after the order is committed to the database. Use this method to perform additional operations after all the order-related records are correctly committed to the database. For information on the RE_Order.DoWork interface methods, see RE_Order.DoWork Interface

API Version
59.0
Signature
global void registerWork(DoWork work)
Example