Create an Apex Controller Class in the Force.com IDE

Create a class to access data from contacts.

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

  1. If you don’t already have an Eclipse project for this org, complete the steps in Create a Force.com Project.
  2. To save changes to the server automatically, right-click the name of the project that you created, then select Force.com | Work Online. When Work Online is enabled, the icon next to your project name looks like this: Work Online icon, rather than like this: Work Offline icon. Working online can lead to long save times, but your Developer Edition org probably has a small codebase, so save times aren’t a concern.
  3. Right-click your project in the Package Explorer, then select New | Apex Class.
  4. Enter MyContactListController in the Name field, and then click Finish.
  5. In the body of the class, between the {} braces, enter this code.

    @AuraEnabled enables client- and server-side access to the controller method.

  6. To save your updated class, press Ctrl+S or (Cmd+S on macOS).