Sublime Text 3 with MavensMate for Force.com Development

Sublime Text provides more user friendly and an awesome environment to work with Force.com. The installation Package is 10 MB only, but the installation can be complete in a few seconds.

MavensMate with Sublime Text 3 provides more user friendly and an awesome environment to work with Force.com. The installation Package is 10 MB only, but the installation can be complete in a few seconds. Sublime Text 3 Support Auto completion of code which lets you complete your coding faster. Using sublime Text 3, you can write a new file to your project or make changes to your existing code which will automatically sync with your salesforce environment with the help of MavensMate, but you need a MavensMate Desktop to work with force.com.

MavensMate Desktop

MavensMate is an open source tool which lets you develop your force.com project using sublime Text 3. MavensMate desktop App can be easily installed in your system and make you to get connected with Salesforce environment.

Mavensmate App working with force.com

Let’s start to work with Sublime Text 3 and MavensMate.

Prerequisites 

1) Install Sublime text 3

2) Install Mavens Desktop (Download [Symbol] MavensMate-Desktop-Setup-0.0.11-beta.6-ia32.exe)

3) Salesforce Developer Account

Sublime Text 3 Setup

1. Download and install Sublime text 3 on your system.

2. Open Sublime Text 3 to install the package control. Go to the link given below and copy the content highlighted.

https://packagecontrol.io/installation#st3
How to install Sublime Text 3 with Force.com

From the top menu, go to view [Symbol] Show Console and paste the content in the console (bottom of the page); then click Enter to run it.

You can view Package Control by clicking Preferences [Symbol] Package Control.

3. Now it’s time to Install MavensMate in Sublime Text 3.

From the top menu, go to the preferences [Symbol] Select Package Control and type install package.

Install Mavensmate in Sublime Text 3

The package will run and show an output Window [Symbol] type mavensmate and select mavensmate to run in your sublime Text 3.

Now, the MavensMate is added to your menu at the top.

4. Install Mavens Desktop (Download [Symbol] MavensMate-Desktop-Setup-0.0.11-beta.6-ia32.exe)

To use MavensMate in sublime Text 3, you need Mavens Desktop in your system. Download and install MavensDesktop in your system.

MavensMate Desktop App

5.Create Project

From the top menu in Sublime Text 3 Click MavensMate [Symbol] Project [Symbol] New Project. MavensMate Desktop will open in your system, then select your Salesforce Environment Type (here I used my salesforce developer Account) and click Connect.

Mavensmate Desktop

It will take you to the Salesforce developer login page. Enter your Username and Password to log in.

Allow the MavensMate to access your Salesforce Information.

Provide the Project Details which include workspace and Project Name. Here I named my project as “DemoProject”.

Select the advanced metadata, if needed.

Select the metadata in which you are going to work. Then, click Create Project.

It shows Project Created Successfully and click Open in Sublime.

Mavensmate Sublime Text

6. Work with Your Project

Now you can see your project folder is opened in Sublime Text 3 and start working with your existing code. Before saving the file, you can see the differences you made in the existing file. This can be seen by right clicking the mouse and selecting “Show Unsaved Changes”.

Mavensmate Sublime Text 3

Save your changes with “Ctrl + S”, it will automatically sync with your salesforce account.

If some other users make changes in the same file from the Salesforce developer environment but not in sublime Text, while saving the file in sublime Text 3, it will show an alert message that A Conflict has been detected”. 

Select Diff with Server to see the changes that are made in the server not by sublime.

Mavensmate Salesforce

You can either override the server code or make the changes as you need.

Using MavensMate Desktop, you can create new files to your project. From MavensMate Desktop, open your project and select the metadata from the menu in the right bar, then click the metadata which you want to create.

MavensMate Desktop App

For example, click new Apex class [Symbol] Select Metadata Template as Default[Symbol] enter the Apex Class API Name as “DemoClass_AC” [Symbol] click Create Metada.

This class automatically gets synced with your Salesforce account. Continue working with the class using Sublime Text 3.

Conclusion 

Sublime Text 3 Provides packages like Apex snippets, Visualforce, etc., which make your coding more flexible. I think now you can understand the basics of using Sublime Text 3 and MavensMate Desktop for your force.com Project.

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.