Skip to main content
[ This file is autogenerated from apexdoc ]

AqRecordWithChildren

Represents a record with its child records in a hierarchical structure. Used to maintain parent-child relationships during mapping operations.

Group modules/mapping tool

Overview​

AqRecordWithChildren is a wrapper class that represents a Salesforce record along with its child records in a hierarchical structure. It's used throughout the mapping tool to:

  • Maintain parent-child relationships during JSON parsing and conversion
  • Track parent field values for embedded object hierarchies
  • Manage child record collections
  • Support hierarchical upsert operations

Usage​

Typically returned from mapping operations:

AqResult result = AqMappingToolService.upsertRecordsFromJson(
jsonString,
'AccountMapping',
true
);

if (result.Severity == AqResult.SEVERITY_SUCCESS) {
List<AqRecordWithChildren> records =
(List<AqRecordWithChildren>)result.ReturnValue;

for (AqRecordWithChildren record : records) {
System.debug('Record ID: ' + record.record.Id);

// Access child records
if (record.children != null) {
for (AqRecordWithChildren child : record.children) {
System.debug('Child ID: ' + child.record.Id);
}
}
}
}

Key Fields​

  • record: The Salesforce SObject
  • children: List of child AqRecordWithChildren (for embedded objects)
  • objectDefinitionDevName: DeveloperName of the ObjectDefinitionMapping
  • parentFieldName: Field name that links to parent (for child records)

See the main module documentation for hierarchical structure examples.

Constructors​

public AqRecordWithChildren(SObject record)​

public AqRecordWithChildren(SObject record, String parentFieldName)​

public AqRecordWithChildren(String objectDefinitionDevName, SObject record)​


Fields​

public record → SObject​

public parentFieldName → String​

public children → List<AqRecordWithChildren>​

public objectDefinitionDevName → String​

public objectAsAMap → Map<String,Object>​

public parentFieldValue → Id​


Methods​

public SObject getRecord()​

public List<AqRecordWithChildren> getParentedChildrenRecordsWithChildren()​

public void addChild(AqRecordWithChildren childRecord)​

public void addChildren(List<AqRecordWithChildren> childRecords)​

public void setParentChangedFlag()​

public Boolean getHasParentChanged()​