SalesforceBlue

Feel the rhythm of Salesforce

Apex

Steps To Create Apex Class

You can create an apex class by following any of the following approaches:

Create Apex Class From Developer Console:

1. log in to your Salesforce org then click on the Gear icon > Developer Console


2. Click on File > New > Apex Class


3. Enter the name of your Apex Class


4. Apex class would be created and would open up for editing. You can either hit cmd + s (mac) / ctrl + s (windows) to save your changes or you can click on File > Save


Create Apex Class From The Setup Menu:

1. login to your Salesforce org then click on the gear icon > Set up


2. Search For Apex Class from the list of left menu items


3. Click on the New button


4. Write up your class in the editor and click on save to save your changes.


Create Apex Class From VS Code:

The prerequisite of this step is that your vs code should be connected to your salesforce org. In case you wanted to know about vs code setup you can refer – VS Code IDE Setup For Salesforce and how to use it over here – Using VS Code IDE For Salesforce

1. Hit cmd + Shift + P (mac) or ctrl + Shift + P (windows) then search for sfdx:Create Apex class and hit enter


2. Enter the name of your class and hit enter


3. Choose the default option and hit enter

4. Make changes to your apex class in the editor

5. Deploy your saved changes back to Salesforce org by hitting cmd + shift + s (mac) / ctrl + shift + s (windows) and looking for the command sfdx: Deploy This Source To Org and hitting it.


Thank you for visiting SalesforceBlue.com
If you have any queries feel free to write down a comment below 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *