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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Metadata</strong> TypesApexClassField NameapiVersionField TypedoubleDescriptionThe <strong>API</strong> version for this class. Every class has an <strong>API</strong> version specified atcreation.contentfullNamestatusbase64stringApexCodeUnitStatus(enumeration of type string)The Apex class definition. Base 64-encoded binary data. Prior to makingan <strong>API</strong> call, client applications must encode the binary attachment data asbase64. Upon receiving a response, client applications must decode thebase64 data to binary. This conversion is usually handled for you by aSOAP client. This field is inherited from the <strong>Metadata</strong>WithContent<strong>com</strong>ponent.The Apex class name. The name can only contain characters, letters, andthe underscore (_) character, must start with a letter, and cannot end withan underscore or contain two consecutive underscore characters. This fieldis inherited from the <strong>Metadata</strong> <strong>com</strong>ponent.The current status of the Apex class. The following string values are valid:• Active - The class is active.• Deleted - The class is marked for deletion. This is useful for managedpackages, because it allows a class to be deleted when a managedpackage is updated.Note: ApexCodeUnitStatus includes an Inactive option, butit is only supported for ApexTrigger; it is not supported forApexClass.Declarative <strong>Metadata</strong> Sample DefinitionThe following sample creates the MyhelloWorld.cls class, and the corresponding MyHelloWorld.cls-meta.xmlmetadata file.MyHelloWorld.cls file:public class MyHelloWorld {// This method updates the Hello field on a list// of accounts.public static void addHelloWorld(Account[] accs){for (Account a:accs){if (a.Hello__c != 'World')a.Hello__c = 'World';}}}MyHelloWorld.cls-meta.xml:30.0See Also:ApexTrigger77

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

Saved successfully!

Ooh no, something went wrong!