Represents the working copy of an Apex trigger for editing, saving or compiling in a MetadataContainer.
Supported SOAP API Calls
create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()
Supported REST API HTTP Methods
Query, GET, POST, PATCH, DELETE
Fields
| Body |
- Type
- string
- Properties
- Create, Update
- Description
- The data for the Apex trigger.
The Body field is the only field
you can update() or PATCH.
|
| Content |
- Type
- string
- Properties
- None
- Description
- A string representation of ApexTriggerMetadata that lists the
version, status, and packaged versions of the corresponding Apex trigger.
|
| ContentEntityId |
- Type
- reference
- Properties
- Create, Filter, Group, Sort
- Description
- A reference to an Apex trigger.
There can be only one ContentEntityId per ApexTriggerMember, otherwise, an error is reported.
This
field is required.
|
| LastSyncDate |
- Type
- dateTime
- Properties
- Filter, Sort
- Description
- The date that this ApexTriggerMember Body was replicated from the underlying entity.
When you deploy
a MetadataContainer, this value is compared with the LastModifiedDate of the underlying Apex trigger. If LastSyncDate is older than LastModifiedDate, the deployment fails with an error.
|
| Metadata |
- Type
- ApexTriggerMetadata
- Properties
- None
- Description
- An object that describes the version, status, and packaged versions
of the corresponding Apex trigger.
|
| MetadataContainerId |
- Type
- reference
- Properties
- Create, Filter, Group, Sort
- Description
- A reference to a MetadataContainer or ContainerAsyncRequest object.
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.
|
| SymbolTable |
- Type
- SymbolTable
- Properties
- Nillable
- Description
- A complex type that represents all user-defined
tokens in the Body of an ApexClass, ApexClassMember, or ApexTriggerMember and their associated line and column locations within
the Body.
This field is null if the symbol table cannot be created. A symbol table cannot be created if the content
referenced by the ContentEntityId field doesn’t
use a symbol table, or if compiler errors for the last deployment
of the MetadataContainer in the MetadataContainerId field
prevented a symbol table from being created.
|
Usage
To edit, save, or compile an Apex trigger, create an ApexTriggerMember object that references it.
To create a new trigger, use the Force.com REST API or the Metadata API.
Once an ApexTriggerMember is successfully
deployed in a MetadataContainer, the MetadataContainerId is changed
to the ID of the ContainerAsyncRequest, and the ApexTriggerMember can’t be modified
or reused.
Apex triggers and classes are often dependent on each other for functionality.
For example, a method in one class can call a method in another class.
If source file A is dependent on modified source file B and you try
to save and compile source file A before you’ve saved the changes
to source file B, the compiler will throw an error. To successfully
save and compile a group of related source files, put the corresponding
ApexTriggerMember and ApexClassMember objects in a single MetadataContainer
object. Use ContainerAsyncRequest to send the MetadataContainer to
the application server.
Each ApexTriggerMember object can only
refer to a single MetadataContainer object. Multiple ApexTriggerMember
objects can refer to the same MetadataContainer object.