12.07.2015 Views

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Metadata</strong> TypesApexTriggerApexTriggerRepresents an Apex trigger. A trigger is Apex code that executes before or after specific data manipulation language (DML)events occur, such as before object records are inserted into the database, or after records have been deleted. For moreinformation, see “Managing Apex Triggers” in the <strong>Database</strong>.<strong>com</strong> online help. This metadata type extends the<strong>Metadata</strong>WithContent <strong>com</strong>ponent and shares its fields.Supported Callsdeploy(), retrieve(), describe<strong>Metadata</strong>(), list<strong>Metadata</strong>()Note: This metadata type is not supported by the create(), delete(), and update() calls.Declarative <strong>Metadata</strong> File Suffix and Directory LocationThe file suffix is .trigger for the trigger file. The ac<strong>com</strong>panying metadata file is named TriggerName-meta.xml.Apex triggers are stored in the triggers folder in the corresponding package directory.VersionTriggers are available in <strong>API</strong> version 10.0 and later.FieldsThis metadata type contains the following fields:Field NameapiVersioncontentfullNamestatusField Typedoublebase64stringApexCodeUnitStatus(enumeration of type string)DescriptionRequired. The <strong>API</strong> version for this trigger. Every trigger has an <strong>API</strong> versionspecified at creation.The Apex trigger definition. This field is inherited from the<strong>Metadata</strong>WithContent <strong>com</strong>ponent.The Apex trigger name. The name can only contain characters, letters,and the underscore (_) character, must start with a letter, and cannot endwith an underscore or contain two consecutive underscore characters. Thisfield is inherited from the <strong>Metadata</strong> <strong>com</strong>ponent.Required. The current status of the Apex trigger. The following stringvalues are valid:• Active - The trigger is active.• Inactive - The trigger is inactive, but not deleted.• Deleted - The trigger is marked for deletion. This is useful formanaged packages, because it allows a trigger to be deleted when amanaged package is updated.Declarative <strong>Metadata</strong> Sample DefinitionThe following sample creates the MyhelloWorld.trigger trigger, and the correspondingMyHelloWorld.trigger-meta.xml metadata file.78

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!