RecordResource Class

Contains constructors and properties to create a record object from field values of an order.

CommerceOrders

Learn more about the available constructors with the RecordResource class.

The RecordResource class includes these constructors.

  • RecordResource(type, method, id)

    Creates an instance of the RecordResource class to assign values to the fields of an order item by using the sObject type, API method, and order ID properties.

  • RecordResource(type, method)

    Creates an instance of the RecordResource class to assign the values to the fields of an order item by using the sObject type and API method properties.

Creates an instance of the RecordResource class to assign values to the fields of an order item by using the sObject type, API method, and order ID properties.

public RecordResource(Schema.SObjectType type, String method, Id id)

type

Type: Schema.SObjectType

Object that’s returned from the field describe result using the getReferenceTo() method or from the sObject describe result using the getSObjectType() method.

method

Type: String

Method for the API request, such as POST or PATCH.

id

Type: Id

ID of the order.

Creates an instance of the RecordResource class to assign the values to the fields of an order item by using the sObject type and API method properties.

public RecordResource(Schema.SObjectType type, String method)

type

Type: Schema.SObjectType

Object that’s returned from the field describe result using the getReferenceTo() method or from the sObject describe result using the getSObjectType() method.

method

Type: String

Method for the API request, such as POST or PATCH.

Learn more about the available properties with the RecordResource class.

The RecordResource class includes these properties.

  • fieldValues

    Set the fieldValues property to assign values to the fields to update the order record.

  • id

    Set the id property to assign the ID of the order record.

  • method

    Set the method property to specify the API request method, such as POST or PATCH.

  • type

    Set the type property to assign the object type that’s returned from the field describe result using the getReferenceTo() method or from the sObject describe result using the getSObjectType() method.

Set the fieldValues property to assign values to the fields to update the order record.

public Map<String,ANY> fieldValues {get; set;}

Type: List<Map<String,ANY>>

Set the id property to assign the ID of the order record.

public String id {get; set;}

Type: String

Set the method property to specify the API request method, such as POST or PATCH.

public String method {get; set;}

Type: String

Set the type property to assign the object type that’s returned from the field describe result using the getReferenceTo() method or from the sObject describe result using the getSObjectType() method.

public Schema.SObjectType type {get; set;}

Type: Schema.SObjectType