Skip to content

queryNetworkByName

queryNetworkByName(connection, name, requestTimeout?): Promise<NetworkRecord>

Defined in: queryNetworkByName.ts:38

Looks up a Network (Experience Cloud site) by name, bounded by requestTimeout with the request cancelled if it stalls. A drop-in for connection.singleRecordQuery(): it throws the same error names (SingleRecordQuery_NoRecords, SingleRecordQuery_MultipleRecords), which @salesforce/core doesn’t export as values.

Connection

The org connection.

string

The Network.Name to find.

Duration = DEFAULT_PUBLISH_REQUEST_TIMEOUT

Bounds the query. Defaults to DEFAULT_PUBLISH_REQUEST_TIMEOUT.

Promise<NetworkRecord>

The matching record’s Id and Name.

SingleRecordQuery_NoRecords / SingleRecordQuery_MultipleRecords unless exactly one matches.