getObjectInfos
Use this wire adapter to get metadata for multiple objects. The response includes metadata describing the fields, child relationships, record type, and theme for each object.
Parameter Name | Type | Description | Required? |
---|---|---|---|
objectApiName | String[] | The API name of a supported object. |
Read the data that's returned by the wire adapter using a property or function.
propertyOrFunction
—A private property or function that receives the stream of data from the wire service.
- If a property is decorated with
@wire
, the results are returned to the property’sdata
property orerror
property. - If a function is decorated with
@wire
, the results are returned in an object with adata
property and anerror
property.
data
—Contains aresults
object with Object Info metadata and status codes.error
—FetchResponse
Get the object metadata using data.results
. The object metadata is returned in the same order they are requested. If a requested object contains an error, the error code and message are returned in data.results[].result
. The error
object is returned only if the server call fails.
To get metadata for multiple objects, use getObjectInfos
. To work with a single object, use getObjectInfo
.
This example returns object info for Account and Opportunity.