Advance Apex debugging in Salesforce and best practices – Videos

How to resolve apex debug log size limit issue, Difference between Eclipse and developer console, Interactive Apex Debugging, Keyboard shortcuts for Developer console and Other best practices

While developing applications on Force.com platform using Apex, I am sure you may have been in need of debugging your code. Salesforce being cloud platform, method to debug code is very different as compared to other programming languages. In this post we will discuss all about Apex code debugging, challenges, solutions and other best practices.

Salesforce Advance Apex debugging
Salesforce Advance Apex debugging

How many ways to debug Apex code

  1. Eclipse Force.com IDE
  2. Debug log
  3. Developer console
  4. Fetch debug log using Tooling API

Continue reading “Advance Apex debugging in Salesforce and best practices – Videos”

Generating Single Executable jar file with all dependencies and libraries using Netbeans and Eclipse

Generating Single Jar file with all dependencies in Eclipse is easy. We just need to follow below steps :

  1. Either from the context menu or from the menu bar’s File menu, select Export.
  2. Expand the Java node and select JAR file. Click Next.
  3. In the JAR File Specification page, select the resources that you want to export in the Select the resources to export field.
  4. Select the appropriate checkbox to specify whether you want to Export generated class files and resources or Export Java source files and resources. (Note: Selected resources are exported in both cases.
  5. If there are other files or resources you want to include they must be in a an open project. Browse to their location via the directory tree on the left and ensure the file or resource is checked in the window on the right.
  6. In the Select the export destination field, either type or click Browse to select a location for the JAR file.
  7. Select or clear the Overwrite existing files without warning checkbox. If you clear this checkbox, then you will be prompted to confirm the replacement of each file that will be overwritten.
  8. Click Finish to create the JAR file immediately.
  9. Now, navigate to the location you specified for the jar. The icon you see and the behavior you get if you double click it will vary depending on how your computer is set up.
  10. You can use this article for images and more detail.

Continue reading “Generating Single Executable jar file with all dependencies and libraries using Netbeans and Eclipse”

Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account

We have seen that how to create First Heroku application using Eclipse. However it is possible that after following all steps properly in above article you may receive error saying

the Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account. To fix this error, you can: – Associate your SSH key to your Heroku account by going to “Preferences” OR – If the SSH Key is correct, restart Eclipse

Eclipse and Heroku SSH key is not matching
Eclipse and Heroku SSH key is not matching

However, if you will login to heroku, you will find that application is already created. Error is only at Eclipse end. Continue reading “Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account”

Automated Daily Backup of Salesforce Using ANT Migration Tool and GIT

In few previous articles, I have talked about how to use “ANT Migration tool in Salesforce” and “How to Use EGit plugin in Eclipse to work with Git“. So to make this article short, I assume that you are already familiar with ANT Migration tool provided by Salesforce and Git.

During project development life cycle it is very essential to backup your code and Configurations daily. However sometimes developers forgot to commit changes in Git, may be  because of workload. It may create an issue if someone wants to check back history of code for that duration, there will be no use of having code repository in place if it cant help us to get out of problem.

In this article, I will move one step further and explain how to setup automated script which will run on your System startup and commit backup of your Salesforce organization into local Git repository without any manual interference.

Salesforce Automated Script for Data Backup Using CommandLine
Salesforce Automated Script for Data Backup Using CommandLine

Continue reading “Automated Daily Backup of Salesforce Using ANT Migration Tool and GIT”

Using GIT with Force.com IDE – Video Tutorial

In this article, we discussed how to use GIT with Eclipse.
I have created Video Tutorial for same which includes

  1. How to Upgrade Eclipse from Helios to Indigo
  2. Install EGIT Plugin
  3. Introduction to Bit Bucket

Edit Static Resource inside Force.com IDE Itself

This tutorial is regarding editing of static resources inside eclipse itself. Normally if we want to edit any file inside zip, first we have to extract and edit the file, zip it again and reload into static resource. To save this round trips and time consuming process I found one very useful eclipse plugin called as “Eclipse Zip Editor“. Although it’s very small tweak however it will save your lot of time and unnecessary trip to Salesforce and Zip tool.

You can download this editor from location “http://sourceforge.net/projects/zipeditor/

Static Resource in Eclipse Before Plugin
Static Resource in Eclipse Before Plugin

Continue reading “Edit Static Resource inside Force.com IDE Itself”

Creating First Application in Heroku using Eclipse

Hello Readers, in this article we will see step by step procedure to deploy your first (Hello World) program in Heroku. There are two ways, first going through series of Commands of “Heroku” and “GIT” and other simple and smart way is to use Eclipse Capability with Heroku. To make things easier we will go by second method.

!Deprecated!

This tool / blog post is deprecated. Please follow this guide to deploying applications to Heroku from Eclipse. If you still want to follow this post, then download Eclipse plugin for Heroku from here.

Prerequisites:

Installation and Set up:
First we will need to Install Heroku Plugin in Eclipse. To install it, Navigate to “Help | Install New Software” and click on “Add” button.

Give any name in website like “Heroku Plugin” and enter this URL in Location https://eclipse-plugin.herokuapp.com/install and click on “Ok” and Finish Installation. It will install the Heroku Plugin required to start your first Plugin.

Next step is setting up your Credentials for Heroku :

Navigate to “Window | Preferences | Heroku”, Here either enter your UserName and Password of Heroku Account and click on “Login” or enter you API key, which you can find by logging into your Heroku Account.

Setting up Credentials for Heroku in Eclipse
Setting up Credentials for Heroku in Eclipse

Continue reading “Creating First Application in Heroku using Eclipse”

Resolve Error “ArtifactTransferException: Could not transfer artifact” or “Failure to Transfer” in Maven

This is very short tips to resolve the errors “ArtifactTransferException: Could not transfer artifact” that may occur in Maven project in Eclipse.

Steps to resolve:

  1. Open folder by running this text (without Quotes) in Search Explorer of Window “%USERPROFILE%.m2”.
  2. After running above command, “m2” folder of maven will open. Now search for file (without Quotes) “*.lastUpdated”.
  3. In this step, delete all the files found by running Step 2.
  4. Now go to Eclipse project and select “Maven | Update Dependency” or “Maven | Update Project”.

By now, your issue will be resolved.

Happy Coding !!!

Authenticate Git using SSH protocol with Eclipse and Egit – Salesforce

In Previous article, i have explained step by step approach to configure Git for Salesforce using Eclipse and Egit plugin. However, i have explained the “https” method to connect Git directly. There are several repositories which does not support the “https” protocol and prefer “SSH” (Secure Shell) protocol.

So, in this article i will extend the previous one by showing how to connect git using “SSH” protocol. In this article i am referring Unfuddle.com

We will need to generate the private key (RSA) which will be unique and locked with the help of secret passphrase.

In Eclipse, Navigate to “Windows | Preferences | General | Network Connections | SSH2″.

Configure Push for SSH Authentication in Git
Configure Push for SSH Authentication in Git

Click on button “Generate RSA Key” and after that provide secret Passphrase (dont forget this passphrase), now save the “private key”, if possible in “.ssh” folder which is located at “C:UsersUseName.ssh”.

Continue reading “Authenticate Git using SSH protocol with Eclipse and Egit – Salesforce”