Newer Version Available
Operations Class
Namespace
Usage
Example: Retrieve Metadata
The following example retrieves the “MyTestCustomMDType” custom metadata record from the subscriber org, and inspects the custom fields.
Example: Deploy Metadata
The following example uses the Metadata API in Apex to update the customField custom field value of the MetadataRecordName custom metadata record and deploy this change into the subscriber org. Because the deployment is asynchronous, you must provide a callback class that implements the Metadata.DeployCallback interface, which is then used when the queued deployment completes.
Operations Methods
The following are methods for Operations.
enqueueDeployment(container, callback)
Signature
public static Id enqueueDeployment(Metadata.DeployContainer container, Metadata.DeployCallback callback)
Parameters
- container
- Type: Metadata.DeployContainer
- Container that contains the set of metadata components to deploy.
- callback
- Type: Metadata.DeployCallback
- A class that implements the Metadata.DeployCallback interface. Used by Salesforce to return information about the deployment results.
retrieve(type, fullNames)
Signature
public static List<Metadata.Metadata> retrieve(Metadata.MetadataType type, List<String> fullNames)
Parameters
- type
- Type: Metadata.MetadataType
- The metadata component type.
- fullNames
- Type: List<String>
- A list of component names to retrieve. For information on component name formats, see Metadata.fullName().
Return Value
Type: List<Metadata.Metadata>