Skip to content

discoverRelationshipFields

discoverRelationshipFields(connection, fields): Promise<string[]>

Defined in: relationshipFields.ts:58

Given an SObject’s describe fields, discover the identifying fields of every parent it references through a single-target lookup or master-detail relationship, and return them as dot-notation relationship paths ready to add to a SOQL field list (e.g. RecordTypeId -> RecordType.Name, RecordType.DeveloperName).

Describe calls for each distinct target object are deduplicated and fetched concurrently; Connection#describe already memoizes per-instance, so repeat calls for the same object name (including calls made elsewhere on the same connection) are cheap.

Connection

The org connection to describe relationship targets with.

Field[]

The describe fields of the SObject being backed up.

Promise<string[]>

Dot-notation relationship field paths, in no particular order.