You can also create an Apex class in the Salesforce user interface.
- Click .
- Click New.
- In the editor pane, enter the following code:
public class MessageMaker { }
- Click Quick Save. You could have clicked Save instead, but that closes the class editor and returns you to the Apex Classes list. Quick Save saves the Apex code, making it available to be executed, yet it also lets you continue editing—making it easier to add to and modify the code.
- Add the following code to the class:
public static string helloMessage() { return('You say "Goodbye," I say "Hello"'); }
- Click Save.
You can also view the class you’ve just created in the Developer Console and edit it.
- In the Developer Console, click the Repository tab.
- In the Setup Entity Type panel, click Classes, and then double-click MessageMaker from the Entities panel.The MessageMaker class displays in the source code editor. You can edit the code there by typing directly in the editor and saving the class.
No comments:
Post a Comment