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.

Namespace 

embeddedai

RecordApexRepresentation Constructors 

Learn more about the constructors available with the RecordApexRepresentation class.

The RecordApexRepresentation class includes these constructors.

RecordApexRepresentation(objectType, recordData, relatedRecordData) 

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.

Signature 

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

Parameters 

  • 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.

RecordApexRepresentation() 

Initializes the RecordApexRepresentation class.

Signature 

public RecordApexRepresentation()

RecordApexRepresentation Properties 

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.

objectType 

Stores the type of the object.

Signature 

public String objectType {get; set;}

Property Value 

Type: String

recordData 

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

Signature 

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

Property Value 

Type: List<embeddedai.ApexMap>

relatedRecordData 

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

Signature 

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

Property Value 

Type: List<embeddedai.RecordApexRepresentation>

RecordApexRepresentation Methods 

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.

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.

Signature 

public static embeddedai.RecordApexRepresentation toRecordApexRep(String jsonString)

Parameters 

  • jsonString:

    Type: String

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

Return Value 

Type: embeddedai.RecordApexRepresentation

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

toString() 

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

Signature 

public String toString()

Return Value 

Type: String