DeployContainer Class

Represents a container for custom metadata components to be deployed.

Namespace

Metadata

Usage

Use Metadata.DeployContainer to manage custom metadata components for deployment. A container must have one or more components before being deployed.

Example

// Use DeployContainer for deployment
Metadata.DeployContainer mdContainer = new Metadata.DeployContainer();
mdContainer.addMetadata(customMetadata);

...

// Enqueue deploy
Metadata.Operations.enqueueDeployment(mdContainer, callback);

DeployContainer Methods

The following are methods for DeployContainer.

addMetadata(md)

Add a custom metadata component to the container.

Signature

public void addMetadata(Metadata.Metadata md)

Parameters

md
Type: Metadata.Metadata
A custom metadata component class that derives from Metadata.Metadata. Avoid adding components to a Metadata.DeployContainerthat have the same Metadata.Metadata.fullName because it causes deployment errors.

Return Value

Type: void

clone()

Makes a duplicate copy of the Metadata.DeployContainer.

Signature

public Object clone()

Return Value

Type: Object

getMetadata()

Retrieves a list of custom metadata components from the container.

Signature

public List<Metadata.Metadata> getMetadata()

Return Value

Type: List<Metadata.Metadata>

removeMetadata(md)

Removes a metadata component from the container.

Signature

public Boolean removeMetadata(Metadata.Metadata md)

Parameters

md
Type: Metadata.Metadata
Metadata component to remove.

Return Value

Type: Boolean

Returns true if the container changed as a result of the call.

removeMetadataByFullName(fullName)

Removes a metadata component from the container using the component’s full name.

Signature

public Boolean removeMetadataByFullName(String fullName)

Parameters

fullName
Type: String
Full name of the component to remove.

Return Value

Type: Boolean

Returns true if the container changed as a result of the call.