ApexComponentMember

Represents the working copy of a Visualforce component for editing, saving, or compiling in a MetadataContainer.

Version 

Introduced in API version 27.0.

Supported SOAP API Calls 

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

Special Access Rules 

  • As of Spring ’20 and later, to access ApexComponentMember, users must have both the View All Data and Customize Application permissions.

Supported REST API Methods 

DELETE, GET, HEAD, PATCH, POST, Query

Fields 

Body 

  • Type: textarea

  • Required: No

  • Properties: Create, Update

  • Description: The data for the Visualforce component.

The Body field is the only field you can update() or PATCH.

Content 

  • Type: textarea

  • Required: No

  • Properties: Update

  • Description: A string representation of ApexComponentMetadata that lists the version, status, and packaged versions of the corresponding Visualforce component.

ContentEntityId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort

  • Description: A reference to a Visualforce component.

There can be only one ContentEntityId per ApexComponentMember, otherwise, an error is reported.

This field is required if FullName is not specified.

  • Relationship name: ContentEntity
  • Relationship type: relationship
  • Refers to: ApexComponent

FullName 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Introduced: API version 31.0

  • Description: The full name of the associated object in the Metadata API. Use to avoid race conditions on create, before you have IDs.

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

This field is required if ContentEntityId is not specified.

LastSyncDate 

  • Type: datetime

  • Required: No

  • Properties: Filter, Nillable, Sort

  • Description: The date that this ApexComponentMember Body was replicated from the underlying entity.

When you deploy a MetadataContainer, this value is compared with the LastModifiedDate of the underlying Visualforce component. If LastSyncDate is older than LastModifiedDate, the deployment fails with an error.

Metadata 

  • Type: complexvalue

  • Required: No

  • Properties: Create, Nillable, Update

  • Description: An object that describes the version, status, and packaged versions of the corresponding Visualforce component.

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

MetadataContainerId 

As part of a successful deployment, this field is reset from the ID of the deployed MetadataContainer to the ID of the corresponding ContainerAsyncRequest object.

This field is required.

Usage 

To edit, save, or compile a Visualforce component, create an ApexComponentMember object that references it. To create a Visualforce component, use the REST API or the Metadata API.

Once an ApexComponentMember is successfully deployed in a MetadataContainer, the MetadataContainerId is changed to the ID of the ContainerAsyncRequest, and the ApexComponentMember can’t be modified or reused.

Note

Visualforce pages and components are often dependent on each other for functionality. To successfully save and compile a group of related source files, put the corresponding ApexComponentMember and ApexPageMember objects in a single MetadataContainer object.

Each ApexComponentMember object can only refer to a single MetadataContainer object. Multiple ApexComponentMember objects can refer to the same MetadataContainer object.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!