“We shape our tools and thereafter our tools shape us” — Marshall McLuhan

Since the prehistoric times tools have played a vital role in human life. Starting from early tools like hammerstones and handaxes to modern day tools like the Airplane, the Internet, and mobile apps, tools have constantly changed the World and are continuing to do so.

The thing about tools is that their mere existence is to help its users achieve something quickly and easily or to solve a problem. This applies to all kinds of tools irrespective of whether we are trying to find cure to a disease or cooking food or building a mobile app.
But nothing is free in this world, tools included. Tools, while useful pose the following challenges:

  • There could be many of them that do the same thing.Making them hard to even discover
  • Not all of them are created equal. It takes time to find the best and preferred tool
  • They work when used in the right context. I.E. “Don’t use sword to cut nails”
  • They all have learning curves (big or small)
  • They all hide tips and tricks (or best practices). You need to use them to know them and take advantage of them.

While tools might pose challenges, history has shown that those who have built/discovered the tools and have mastered the art of how to use them effectively have ruled the World (in their own right). For example those who have mastered fishing hooks have not only survived but have thrived in harsh weather conditions. Similarly those who were great at swords and other weapons have won battles and wars.

Tools play a similar role in every field but the number of tools you need depends on the complexity of the task you are trying to achieve. Developing a mobile app being a relatively complex task, it demands usage of many other tools. And that in turn makes knowledge and expertise of tools that much more important.

So if you are developing software, don’t just use few features of a tool but make sure to set aside enough time to discover as much as you can and figure out tips and tricks associated with them.

Tips on mastering tools:

  1. Search for “top tools for doing xyz” and try few of them and see which one does the best job AND which one you are comfortable with.
  2. Several tools come with “Tips and Tricks” dialog boxes. Don’t turn them off it is there to help you (although it could be little annoying).
  3. Search for “tips and tricks on using xyz” online.
  4. Many tools come with plugins to enhance their capabilities. Search for plugins and try them out.
  5. Many tools have ‘keyboard shortcuts’ or other shortcuts. Don’t try to learn them all at once – they are like dieting take it slow and steady. Generally try to learn just 1 shortcut per week.
  6. Stick with one tool but keep on the lookout for better tools

Tools, Tips and Tricks for developing mobile apps on Salesforce (Part 1):

Developing mobile apps on Salesforce of course involves using various tools and they can be broadly classified into the following categories.

  1. Tools to interact with Salesforce database (i.e. SOAP and REST tools).
  2. Tools to help code and debug your apps (i.e. IDEs, chrome developer tools etc.)
  3. Functional and performance testing tools (QUnit, Jasmine, YSlow etc).
  4. Packaging and distribution tools (Yeoman.io, grunt etc.)

 

Tools to interact with Salesforce database:

In this blog we will cover #1 and list tools to interact with Salesforce and will cover the rest in the future blogs.

1. Workbench (http://wiki.developerforce.com/page/Workbench)

Just a like a real workbench, Workbench is designed to be an application administrators and developers can use to quickly view their organizations’ data and metadata, test and troubleshoot their own applications, and be a one-stop shop for interacting with the various Force.com APIs.

(Click on the pics to zoom in)

 
2. Query Editor (Salesforce Query Editor)

Salesforce > Your name > Developer Console > Query Editor tab. This tab is part of Salesforce Developer Console and allows you to quickly run some SOQL queries. This can come in handy if you have already opened Developer Console for debugging or testing Apex code.

 
3. PocketSoap’s SoqlX (http://www.pocketsoap.com/osx/soqlx/)

SoqlX is a tool for developers using the Salesforce.com platform, it allows you to easily explorer your schema, write and run SOQL queries, make edits to data, and to run Apex code.

4. DEV HTTP Client Chrome Browser plugin (DEV HTTP client Web store url)

This is one of my favorite Chrome browser plugins. I’ve been using to quickly test http requests for Salesforce and other services for a long time. One thing that comes in really handy is that it stores all your queries so you can come back and reuse or make a little change and reuse instead of typing entire queries.

5. Ajax toolkit shell (aka Debug Shell) (https://login.salesforce.com/soap/ajax/27.0/debugshell.html)

A lightweight online tool also allows you to perform regular SOQL, SOSL queries. It comes with auto-complete and most of the operations are under sforce.connection and sforce.sObject. We use this the most when we need to quickly get hold of ‘sessionId’.

For example: To get sessionId, simply login to https://login.salesforce.com/soap/ajax/27.0/debugshell.html and type: sforce.connection.login(yourEmail, yourPwd); and hit enter. You’ll see something like below: 

6. CURL
Good old cURL remains extremely popular among linux/mac developers. You can obviously do any kind of http requests to query Salesforce or any other services. Here is couple of examples of how you can use cURL against Salesforce:

  • Get SessionId via POST:

See http://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_quickstart_login.htm

  • Get two contacts:
    curl -H 'Authorization: OAuth  YOUR_SESSION_ID https://na15.salesforce.com/services/data/v20.0/query/?q=SELECT+name+from+Contact+limit+2'

6.1 CURL Tips and tricks

  • Make sure to use single quotes around sessionId, coz sessionId might have “!” and other special characters.
  • Make sure to prepend ‘OAuth <space>’ to your sessionId for “Authorization” header
  • Pretty print.  Pass -H “X-PrettyPrint:1″ to prettyprint and easily see SOAP/JSON results.
curl -H 'Authorization: OAuth YOUR_SESSION_ID' -H 'X-PrettyPrint:1' https://na15.salesforce.com/services/data/v27.0/query/?q=SELECT+name+from+Contact+limit+2
{
  "totalSize" : 2,
  "done" : true,
  "records" : [ {
    "attributes" : {
      "type" : "Contact",
      "url" : "/services/data/v20.0/sobjects/Contact/003i0000005zwGpAAI"
    },
    "Name" : "Rose Gonzalez"
  }, {
    "attributes" : {
      "type" : "Contact",
      "url" : "/services/data/v20.0/sobjects/Contact/003i0000005zwGqAAI"
    },
    "Name" : "Sean Forbes"
  } ]
}

 


Now those are the main tools available to interact with Salesforce database. Internally the unofficial popularity of these tools are in the following order #1, #6, #5, #2, #3, #4. Go ahead and use the tips mentioned earlier to pick few of them and see which one works the best.

As I mentioned earlier, I will cover other tools, tips and tricks related to developing mobile apps on Salesforce.

Finally, remember tools are there to help you and it is as important to learn about tools as learning programming languages and design.
- Cheers!
Raja (@rajaraodv)

tagged , , Bookmark the permalink. Trackbacks are closed, but you can post a comment.