Three Best Ways to Write Code in Salesforce

Feedback

I have already written two post on salesforce about how to create a developer account in salesforce and how to use eclipse IDE  in salesforce , In today post i will show you three ways of writing the apex classes , trigger , test class and visualforce pages in salesforce , so lets see how to write code.

Writing apex classes , trigger , test class and visualforce pages using Eclipse IDE

As I told you earlier that in the last post i have shown you how to install eclipse IDE for writing code in salesforce now let’s see how to write classes (controller and extensions), triggers, test classes and visualforce pages in the salesforce after installing the eclipse IDE , so see first point below .

1.)Open the eclipse IDE that you have installed recently and create a new project by right clicking on the right hand section and then choose the project , see image below

create new project in eclipse IDE

2.) Choose the force.com project and click on next, see below image.

choose force.com project3.) In new window enter your all the login credentials and security token to log in your account , see below image for more details.

enter login credentials

4.) In a new window click on next button and your project is being created and it includes all of your files , now right click on your project and choose the other , see below image for more details .

select other in eclipse IDE

Now a new window will pop up in that window choose what kind of file you want to create , see below image.

select type of file u want to create

That’s it now your file have been created and the files will move to specific folder depends upon what kind of file you have created .

Writing apex classes , trigger , test class and visualforce pages using Developer Console

Its one of the easy way to do coding in salesforce using there developer console , developer console is very easy to access you just need to click on drop down of your user name at the header and in drop down click on developer console , see below image for more details .

developer console

Once developer console is opened click on new button and then choose what kind of file you want to create , see below image for more details.

click on new button to create new files

That’s how we can write code in salesforce using one of there utility , let see another way of writing code using there other utility .

Writing apex classes , trigger , test class and visualforce pages in Development Mode

When i start learning salesforce this is the first way that i learn to code in salesforce because it is the most simplest way and also provide you code intelligence feature for visual force pages development , so to enable development mode in the salesforce you need  go to your personal information to do that go to Personal Setup and in that go to personal information , see below pic for more details .

personal information salesforce

In the right hand section of personal information find development mode ,  if it is already checked leave it as it is but if not click on edit button and mark it checked  , see below image .

development mode in salesforce

Click on save then and  then create a simple visual force page by entering the below URL in the location box.

https://c.ap1.visual.force.com/apex/nameofyourvisualforcepage

You will see an error page doesn’t exist do you want to create click on create the page , you new visual force page is being created and in the down of the window you will see a development window , see below pics for more details.

developemnt mode

 

That’s it all is done i hope you like my this post and if you have some problem and issue please leave comment below in the comment section and also don’t forget to subscribe to my blog and like facebook and google plus pages .

Related Articles :

Speak Your Mind

*