I am not sure if this question gets closed but looking for shortcuts in Force IDE similar to what we have in Java. https://stackoverflow.com/questions/1028858/useful-eclipse-java-code-templates

I am sure people who are working on salesforce for a long time would definitely have some templates.

Please share with us and it definitely helps people like me who are new and coming from Java background.

| improve this question | | | | |
  • 2
    I'm not sure about the Force.com IDE, but I know MavensMate has a selection of templates. MavensMate-Templates – Daniel Ballinger Aug 20 '15 at 19:51
  • @DanielBallinger , Thanks for the link. I used Mavensmate IDE for a week but the saving file to the server was very painful. At time it would take around 5 mins..I wish we had all these features in Force IDE. – javanoob Aug 20 '15 at 20:02
  • @javanoob Most people see better performance with recent MavensMate than the Force.com IDE. And it looks like MavensMate has succeeded in attracting a community who contribute templates but the Force.com IDE has not. So I suggest you take another look at MavensMate. – Keith C Aug 20 '15 at 23:44
  • @KeithC I have used both MavensMate and Eclipse Force.com IDE for a while, and I am still using both for daily work. Considering the speed of compilation and refreshing from server, MavensMate is no comparison to Force.com IDE. I would say the success of MavensMate is the success of Sublime, not itself. – Lance Shi Aug 20 '15 at 23:52
  • @KeithC Are you not facing this problem github.com/joeferraro/MavensMate/issues/478 --Actually this led me to use ForceIDE – javanoob Aug 21 '15 at 1:08

Hope that it will help developers how want create custom Apex templates in Eclipse IDE.

Currently the Salesforce Plugin for Apex Provides you with:

  • ApexClass-Default
  • ApexClass-Inbound_Email_Service
  • ApexClass-Test_Class

You can add your custom template to the above list and it shows up, its simple:

  1. Navigate to the Eclipse Installation Folder –> Configuration –>org.eclipse.osgi . Search for .template. You can see the files listed above.
  2. Open any of the ApexClass* file using your fav text editor.
  3. Modify the file. Add custom comments , descriptions etc.
  4. Save the file as ApexClass-.template.
  5. Restart your Eclipse.
| improve this answer | | | | |

Based on the comment chain, I don't believe the Force.com IDE currently has Apex Code Templates.

I do know that MavensMate in sublime has templates when creating new components. See MavensMate-Templates.

| improve this answer | | | | |
  • Looks like I had tooling api turned off in my mavensmate..now after turning on the save time is greatly improved also I see there are so many other cool features in mavensmate..I am loving it! and no more feel like coding in EditPlus :) – javanoob Aug 26 '15 at 20:37
  • Go to File -> New -> Apex Class
  • Select a project and Choose a class name and click Next>
  • You'll see the following: "Templates are 'New Class' templates found in the Apex Editor Templates preference page."On the bottom of the pop-up window.
  • Click on Apex Editor Templates
  • The Templates preference window pops up and here you can create your new templates, modify existing one or delete them.


| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.