ApexClass

Represents an Apex class. For information, see the Apex Developer's Guide.

Note
Although Apex classes and triggers have the Create and Update field properties set to true, a runtime exception occurs if you try to create or update them using the API. Therefore, use the Force.com Migration Tool, the Salesforce.com user interface, or the Force.com IDE to create or update Apex classes or triggers.

Supported Calls

create(), update(), delete(), query(), retrieve(), describeSObjects(), getDeleted(), getUpdated()

Fields

Field Field Type Field Properties Description
ApiVersion double Create

Filter

Nillable

Update

The API version for this class. Every class has an API version specified at creation.
Body textarea Create

Nillable

Update

The Apex class definition.

Limit: 100,000 characters.

bodyCrc double Create

Defaulted on create

Filter

Nillable

Update

The CRC (cyclic redundancy check) of the class or trigger file.

IsValid boolean Create

Defaulted on create

Update

Indicates whether any dependent metadata has changed since the class was last compiled (true) or not (false).
LengthWithoutComments int Create

Filter

Update

Length of the class without comments.

Name string Create

Filter

Update

Name of the class.

Limit: 255 characters

NamespacePrefix string Filter

Nillable

The namespace prefix associated with this object. Each Developer Edition organization that creates a managed package has a unique namespace prefix. The limit is 15 characters. You can refer to a component in a managed package by using the namespacePrefix__componentName notation.

The namespace prefix can have one of the following values:

  • In Developer Edition organizations, the namespace prefix is set to the namespace prefix of the organization for all objects that support it. There is an exception if an object is in an installed managed package. In that case, the object has the namespace prefix of the installed managed package. This is the namespace prefix of the Developer Edition organization of the package developer.
  • In organizations that are not Developer Edition organizations, NamespacePrefix is only set for objects that are part of an installed managed package. There is no namespace prefix for all other objects.
Status picklist Create

Filter

Restricted picklist

Update

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 managed packages, because it allows a class to be deleted when a managed package is updated.
Note
The ApexTriggerStatus field includes an Inactive option, but it is only supported for ApexTrigger. For more information, see the Force.com Metadata API Developer's Guide.

Usage

For more information about Apex classes, see the Force.com Apex Code Developer's Guide.

© Copyright 2000-2009 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.