Newer Version Available
MetadataContainer
Manages working copies of ApexClassMember, ApexTriggerMember,
ApexPageMember, and ApexComponentMember objects, including collections of objects to be
deployed together.
Supported SOAP API Calls
create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()
Supported REST API HTTP Methods
Query, GET, POST, PATCH, DELETE
Special Access Rules
As of the Spring '20 release, to access MetadataContainer you must have the View All Data user permission and either the Author Apex user permission or the Customize Application user permission.
Fields
| Field Name | Details |
|---|---|
| Name |
|
Usage
Use a MetadataContainer as a package for your tool’s workspace. As a user works in the tool, update the ApexClassMember, ApexTriggerMember, ApexPageMember, and ApexComponentMember objects in the MetadataContainer and use a ContainerAsyncRequest object to save and deploy changes to the current organization.
A MetadataContainer can be reused, but container members can’t.
- When a ContainerAsyncRequest completes successfully, the MetadataContainerId field on all container members is changed from the ID of the MetadataContainer to the ID of the ContainerAsyncRequest. At this point, container members can no longer be modified or deployed, and can’t be queried via the MetadataContainer; you have to query the ContainerAsyncRequest to see what was deployed.
- If the deployment fails, container members remain on the MetadataContainer and can still be modified until they are successfully deployed on another ContainerAsyncRequest. The MetadataContainerId field on the completed (failed deployment) ContainerAsyncRequest is set to the ID of the MetadataContainer, so you can have multiple completed ContainerAsyncRequests on a single MetadataContainer.