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.

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’s data property or error property.
  • If a function is decorated with @wire, the results are returned in an object with a data property and an error property.

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.