Create New Apex Class

Force.com IDE is in a maintenance-only state. We still provide support for the product through our official channels, but updates prior to October 12, 2019 will be only for critical security issues that arise. On October 12, 2019, we will no longer provide support or updates of any kind for Force.com IDE. On that date, we will also begin archiving documentation and removing download links for the product. We recommend that you start migrating to Salesforce Extensions for Visual Studio Code or one of the great tools made by our partners. For more information, see The Future of Salesforce IDEs on the Salesforce Developers Blog.

Warning

To launch the Create New Apex Class wizard, select File | New | Apex Class or right-click your project and choose New | Apex Class. The wizard allows you to choose a template for the new class.

Field Description
Name Enter a name for the class. Salesforce recommends following Java standards for naming, that is, classes start with a capital letter, methods start with a lower-case verb, and variables have meaningful names. It is not legal to define a class and interface with the same name in the same class, or an inner class with the same name as its outer class. However, since methods and variables have their own namespaces within the class, it is legal for a variable, method, and a class within a class to have the same name.
Version Select the version of the API this object conforms to from the dropdown list.
Template Optional. Select a template for the Apex class from the drop-down list:
  • Default - Creates a class without a template.
  • Test Class - Creates a class with the @isTest annotation. Classes defined with the @isTest annotation do not count against the organization size limit for Apex scripts.
  • Inbound Email Client - Creates a class that processes the contents, headers, and attachments of inbound e-mail.