The CartExtension.OrderGraph is a collection of order related SObjects which will be used to create an order in the database.
You should set the SObject fields first, then call the ‘addNode’ method to add the SObject to the CartExtension.OrderGraph.
When a SObject is added to the OrderGraph, the Id field is automatically populated with a temporary referenceId only if the value is null.
The referenceId will be replaced with database Id when the CartExtension.OrderGraph is returned in the CartExtension.CreateOrderResponse and saved in the database.
As the referenceId is not a real database Id, you cannot invoke the ID class method with it, but you can use it to set the foreign key
value in related entities, for example: orderItem.OrderId = order.Id.
Do not try to modify the referenceId value; otherwise the CartExtension.OrderGraph cannot be saved in the database.
Constructors
global OrderGraph()
Constructor for CartExtension.OrderGraph An empty order object is created in the graph. Id field is populated with a referenceId value
Methods
global Order getOrder()
Get the Order object.
Returns
Type
Description
Order
Order
global List<OrderDeliveryGroup> getOrderDeliveryGroups()
Get all the related OrderDeliveryGroup objects.
Returns
Type
Description
List<OrderDeliveryGroup>
List
global OrderGraph addNode(OrderDeliveryGroup node)
Add an OrderDeliveryGroup object to the graph. OrderId will be set if it is null.
Returns
Type
Description
OrderGraph
OrderGraph
global List<OrderItem> getOrderItems()
Get all the related OrderItem objects.
Returns
Type
Description
List<OrderItem>
List
global OrderGraph addNode(OrderItem node)
Add a OrderItem object to the graph. OrderId will be set if it null.
Returns
Type
Description
OrderGraph
OrderGraph
global List<OrderDeliveryMethod> getOrderDeliveryMethods()
Get all the related OrderDeliveryMethod objects.
Returns
Type
Description
List<OrderDeliveryMethod>
List
global OrderGraph addNode(OrderDeliveryMethod node)
Add an OrderDeliveryMethod object to the graph If the Id value of the OrderDeliveryMethod node is not null, the Id value will be kept; otherwise, the id field will be populated with a referenceId.
Returns
Type
Description
OrderGraph
OrderGraph
global List<OrderAdjustmentGroup> getOrderAdjustmentGroups()
Get all the related OrderAdjustmentGroup objects.
Returns
Type
Description
List<OrderAdjustmentGroup>
List
global OrderGraph addNode(OrderAdjustmentGroup node)
Add a OrderAdjustmentGroup object to the graph. OrderId will be set if it is null
Returns
Type
Description
OrderGraph
OrderGraph
global List<OrderItemAdjustmentLineItem> getOrderItemAdjustmentLineItems()
Get all the related OrderItemAdjustmentLineItem objects.
Returns
Type
Description
List<OrderItemAdjustmentLineItem>
List
global OrderGraph addNode(OrderItemAdjustmentLineItem node)
Add a OrderItemAdjustmentLineItem object to the graph
Returns
Type
Description
OrderGraph
OrderGraph
global List<OrderItemTaxLineItem> getOrderItemTaxLineItems()
Get all the related OrderItemTaxLineItem objects.
Returns
Type
Description
List<OrderItemTaxLineItem>
List
global OrderGraph addNode(OrderItemTaxLineItem node)
Add an OrderItemTaxLineItem object to the graph
Returns
Type
Description
OrderGraph
OrderGraph
global OrderSummaryAdditionalInfo getOrderSummaryAdditionalInfo()
Get the related OrderSummaryAdditionalInfo object, and it could be null.
Returns
Type
Description
OrderSummaryAdditionalInfo
OrderSummaryAdditionalInfo
global OrderGraph addNode(OrderSummaryAdditionalInfo node)
Add an OrderSummaryAdditionalInfo object to the graph. The existing OrderSummaryAdditionalInfo object will be replaced, as only one OrderSummaryAdditionalInfo object can be associated with a CartExtension.OrderGraph