RecordApexRepresentation Class

Contains properties and a method to create a serializable representation of a record and its associated data for AI service integration and data processing.

embeddedai

Learn more about the constructors available with the RecordApexRepresentation class.

The RecordApexRepresentation class includes these constructors.

Initializes a new instance of the RecordApexRepresentation class with the specified object type, primary record data, and related record data. This constructor represents a structured record and its relationships for consumption by embedded AI logic.

public RecordApexRepresentation(String objectType, List<embeddedai.ApexMap> recordData, List<embeddedai.RecordApexRepresentation> relatedRecordData)

  • objectType:

    Type: String

    The object type represented by this record (for example, Account, Case, or a custom object). This value defines the context in which the record data is interpreted by embedded AI processing.

  • recordData:

    Type: List<embeddedai.ApexMap>

    The field-level data for the primary record as a collection of key–value pairs. Each ApexMap entry corresponds to a field name and its associated value used to construct the record context.

  • relatedRecordData:

    Type: List<embeddedai.RecordApexRepresentation>

    Related records associated with the primary record. Each entry represents a related object and its data, enabling hierarchical or relational record context to be passed to embedded AI logic.

Initializes the RecordApexRepresentation class.

public RecordApexRepresentation()

The following are properties for RecordApexRepresentation.

  • objectType

    Stores the type of the object.

  • recordData

    Stores a list of objects, where each object holds a key-value pair.

  • relatedRecordData

    Stores a list that contains a child or related records associated with the record data.

Stores the type of the object.

public String objectType {get; set;}

Type: String

Stores a list of objects, where each object holds a key-value pair.

public List<embeddedai.ApexMap> recordData {get; set;}

Type: List<embeddedai.ApexMap>

Stores a list that contains a child or related records associated with the record data.

public List<embeddedai.RecordApexRepresentation> relatedRecordData {get; set;}

Type: List<embeddedai.RecordApexRepresentation>

Create detailed, hierarchical record objects and convert them to a custom JSON string for structured AI input.

The following are methods for RecordApexRepresentation.

  • toRecordApexRep(jsonString)

    Converts a JSON-formatted string into a RecordApexRepresentation instance. This method parses the provided JSON and constructs a structured record representation that can be used by embedded AI logic.

  • toString()

    Returns a structured JSON string representation of the RecordApexRepresentation object and its nested related records.

Converts a JSON-formatted string into a RecordApexRepresentation instance. This method parses the provided JSON and constructs a structured record representation that can be used by embedded AI logic.

public static embeddedai.RecordApexRepresentation toRecordApexRep(String jsonString)

  • jsonString:

    Type: String

    The JSON-formatted string containing record data and related record information to be converted into a RecordApexRepresentation object.

Type: embeddedai.RecordApexRepresentation

Returns a RecordApexRepresentation instance populated with the data parsed from the provided JSON string.

Returns a structured JSON string representation of the RecordApexRepresentation object and its nested related records.

public String toString()

Type: String