Another presentation for the London Salesforce Developer Group using mobile app. 

When it comes to Salesforce development, we all know what it takes to deliver stuff. Having a certified professional helps you gain a knowledgeable partner but what about the things such as common sense?  We all know how to deliver things on client requirements but what about things that are not mentioned by the client. We will be discussing in details things that will enhance the user experience, focus on tips to read your customers mind and have a bit of perspective on the user experience.

Read More
An overview and necessity of the agile methodology, and how it can be leveraged in Software development. A guide for individuals to work as part of an agile team and start thinking about features and less thinking about the product. Delivering a presentation with mobile.

Read More
Photo by John- Mark Kuznietsov 

If someone gave me a pence for every time there was an SOQL query in an APEX Class without using Limit or a condition during a code review, I could afford a Lamborgini this month. Sigh. If only. We make it a habit of going digging for data, at the very moment we need it. The crux of this problem happens when you have chain classes which are independent of each other. Each class needs the reference from a single record and we have to query for that record every single time.

While we don't see it, every SOQL query has a cost to it, and it does not go in my Lamborghini fund, however, it should. In a recent project, we had to construct an Account 360 page that could fetch information from different integration points. The page was also called using a live telephony integration, which could pass the phone number for the account. This required an ability to keep in context the Account that was on call.

Platform Cache: Infographic
Passing the Account id in URL parameter was a valid option, however, any manipulation of that ID would be flagged as a security risk in the code. Besides querying the same data again and again during a single transaction is annoying. Clever developers (case in point) adopt the use of cookies or pass the reference as an URL parameter (Sidebar: DO NOT PUT STUFF IN URL PARAMETERS). Some people even went into Mordor and went ahead to use Custom Settings as a Cache, which makes no sense as it is as good as wasting the DML.For our problem, we adopted the use of browser cookie to maintain the account information in context.

It all comes to this- there was no proper way to keep a record in context or on the platform- until now. It was therefore when there was an announcement for Platform Cache, I wept with tears of joy. And also repeated those when I dreamed of removing the set Cookie and get Cookie from my class.

So Platform Cache API happened. The Platform Cache API lets us store and retrieve data that’s tied to Salesforce sessions or shared across your org. With Platform Cache, Salesforce adds a memory layer to its architecture. We can also control which apps can use the cache and partition it accordingly.

Here comes a bad news followed by a good one. The developer Org has no space for Cache allocated by default, but the good news is we can ask for a trial version of the same. Have provided the link at the very bottom to request your cache trial.
There are two types of Cache:

Org Cache:
The Org cache stores information that is available org-wide. It could be used instead of Custom Settings and we can save some DML statement.

Session Cache:
This is my personal favorite. Session cache can replace the horrible methods of storing information in cookies and URL parameters. We can use the session cache to store user session information that gets wiped clean every eight hours. It can be used as a cache to store the data used for the whole day.

Had a chance to brush my hands against the partition, so here is my little playground. Remember, the problem statement I talked about earlier? I had to keep the account information in context as the page kept fetching different information. The architecture for the solution was as follows:

Whenever there is a new phone call, I store the customer information in the user's cache.

Cache.OrgPartition custPart=Cache.Org.getPartition('Customer');
Account customer=[select id, Name from Account where phone=:calledID];
custPart.put('Customer', customer);

And then, every time I have to fetch the customer or want to find if the customer is on the phone call- all I do is, fetch this information from the partition.

Cache.OrgPartition custPart=Cache.Org.getPartition('Customer');
Account customerOnCall=(Account) custPart.get('customer');
System.debug('Customer on call? = ' + customerOnCall);

If my consultant is on a phone call, I get the customer information or I get a NULL value. Cache partition is going to solve a lot of transaction level problems. The use of this feature is only limited to our imagination.

What do you think? Is there a better way of using this?

Further reading:
Read More
Hello New Year,

Those of you who have barely made it to the 1st, congrats. 2016 has been officially branded as the worst bringer of bad news and us, you and me, have survived and entered 2017. So once again congrats on making it here.

Last year, Salesforce shocked everyone by announcing Lightning, a fundamental and drastic change to the very core of salesforce delivery. The message was simple- this was a major transition in the IT services and if they have not already, all the customers would want their CRM on portal devices. When Lightning was announced, it was like relocating the passengers from a completely full Boeing 404, sturdy durable and slow to the superfast Mig 41 that could deliver fast, break the sound barrier and was efficient- only this was mid-air.

This was a paradigm shift, however, you may want to deny it, and it was fundamentally necessary. But like it or no, the shift happened. And suddenly there was a lot of material out there and every other product that was launched henceforth was labeled Lightning. The good old Visualforce developer that I am, stood behind the crowd in anticipation of what was happening. There were talks, there were webinars, there was stuff happening- and all at lightning speed.

Therefore, it took a while to sort through the noise, cut to the very basics and understand how Lightning works. That effort is now presented in front of you in form of five bullet points that will help you transition successfully to Lightning.

And so we begin, the most fundamental tip that will help you understand Lightning is-

1. Don't Panic

The classic #1 tip given for the average traveler across the galaxy comes in handy when we begin to understand Lightning. There is a lot of material out there for understanding lightning, ready-made components to be used in your code. Start small. If you are familiar with JavaScript you are already there. If not, start now.
Let me repeat this for you, JavaScript is the first step in your transition to Lightning. The golden rule to learning a new language is to write the "hello world" code. A simple code that will get the hang of things. Lightning follows the pattern of any Javascript-based programming language, like AngularJS. Familiarity with one is an added advantage, if not, start learning. Once you get a hang of things, it is really fun to work with.

One way to ease into lightning is to create a basic app fit for your purpose. The Salesforce trailhead gives you a good start into the same.

2. Adopt M-VC

We are programmed to think in an MVC model of programming. We write an apex controller that contains the business logic and queries, the Visualforce page that displays the data. 
A Lightning Component uses the same concept of MVC but here the business logic and display view are written together, while the controller is only used to fetch data. This is the pattern followed by a lightning component. If you have been working on Visualforce/Apex Controllers for a while, it will feel odd initially but once you get a hang of it, building a Lightning component is the best thing you will every do.

3. Write Components inside Pages

With Visualforce, we have practiced hard to write pages for our solutions. We over-use the PageReference apex code to navigate users through the Visualforce wizards. Lightning brings with the most important aspect missing in visualforce pages, it brings the inheritance to the table.
Think of this as writing only Visualforce components instead of Pages. You can further inherit that component into another specializes component for specific use.

4. Everything is in the name

One of the early mistakes I made was not naming the components in the log. If you have a large number of components on the same page and all of them are interacting at the same time, debugging them becomes the stuff of nightmares if you do not name them properly. Create a name attribute to the component that you create and then use this name in the log messages that are generated in the code. You will thank me later for this tip.

5. Javascript is Case Sensitive

A moment of pause to all those who wasted an entire day to realize the problem was onClick. Yes, Javascript is case sensitive. Therefore, if you have a habit of using CamelCase or Camelcase, make sure you maintain consistency. This stuff of nightmare pops up at an unsuspecting time, have faced it many times when trying to access the obj.fieldname but it should be Obj.Fieldname

Some resources that will help you ease into Javascript and further into Lightning:

JS the Right Way

Trailhead (Duh uh)!

All the best and as always May the Force Be With you!
Read More

Every developer worth their salt knows that the easiest way of redirection from a page to another is by using everyone's favorite function

  public PageReference redirect() {
       PageReference pageRef = page.peskyProblemRedirection; 
       return pageRef; 

And the method is called by adding it to the Action attribute of the CommandButton or link, which works like charm and the user is redirected to the page after completion of the action.
So why am I going back to the basics? Because this way of redirection causes a pesky little problem in using the Service Cloud or Sales Cloud console.

Let's illustrate the problem, let's say you have a visualforce page as follows:

<apex:page sidebar="false" showHeader="false" controller="myExampleController">
<apex:form >
<apex:pageBlock >    
         <apex:pageBlockButtons >
             <apex:commandButton action="{!Redirect}" value="Next Page"/>

The controller to this class is as follows:

public with sharing class myExampleController {
  public PageReference redirect() {
       PageReference pageRef = page.peskyProblemRedirection; 
       return pageRef; 

This does what it says, you click a button and it takes you to the next page seamlessly.

The Problem

But now let's see when this page is added to the Salesforce Console.
Let's run the same code inside the console.

1. This is our first page
2. If we take a peek under the hood, we open the link of the tab inside the console and it shows our first page. PeskyProblemPage

3. Do the thing, click on next page and voila, we are redirected to the next page- as expected.

4. But here is where the problem starts- if we take a peek under the hood of the second page, we see things are not as they seem. If we click on the link of our second page as shown in annotation number 2 in the figure below, we notice that the link has not changed as shown in annotation number 3

Why is this a problem? That is because Salesforce does not auto refresh its pages every time and let's say the user refreshes the second page- it reopens the first one because the link still points to the first page. So what works here? The console toolkit, that can be referenced here, tells us that most of the console can be accessed navigated by using a Javascript library.


One solution for this issue is the use of Native OpenPrimaryTab method of the Console toolkit API. So we rewrite the page again using the Console Toolkit API, this time, however, we will set the redirection on the page itself.

So our new Page becomes as follows:

    <apex:includeScript value="/support/console/28.0/integration.js" />
    <script type="text/javascript">
        //Get the enclosing primary tab, if you want to open a new tab, ignore this method
        var openPrimaryTab = function openPrimaryTab() {

        //Whatever the result, open it in the same tab
        var callOpentab = function callOpenSubtab(result) {
                '/apex/peskyProblemRedirection', true, 'Page two');


            <apex:sectionHeader title="Page one" />
                <apex:commandButton onclick="openPrimaryTab()" value="Next Page" />


As you can see, the magic happens using the onclick function that sets the page redirection on a console. If there is an action to perform before redirection, the same function can be used in oncomplete attribute of the button.

Taking this further,

This example above gives us the basic idea of how the redirection works on the console. Let's say you need to generate a dynamic page URL based on the data manipulation in the action method. E.g., send accountID to the new page from the tab. This can be achieved by using javascript remoting and calling the apex method in javascript. Take a look at the UNTESTED code below, that can get you started on exploration:

<script type="text/javascript">
    function getRemoteAccount() {
            function(result, event) {
                if (event.status) {
                        '/apex/peskyProblemRedirection?id=' +,
                        true, 'Page two');

            }, {
                escape: true


The possibilities are only limited by your imagination. Working with the Console in the past couple of years has given a greater sense of many things Salesforce developers usually take for granted. But once you get hang of it, Console is the best product ever made by Salesforce (Yes better than Lightning too!!!)

Have you encountered this problem before? Do you have any other solution? Share your experience in the comments below
Read More
In the immortal words of a certain machine returning back in time, I am back. For now. After procrastinating for over a year and drafting a lot of rants- I am back with a very important coding lesson for you. For now.

When we are designing a Visualforce page or an app or a lightning component (added that only to trick google) or any web page for that matter, we often tend to wrap up things quickly. Ask anyone on the team, how to design a good User Experience? and the person will immediately throw buzz words like Bootstrap, angular and other useless libraries (did someone squint?)

Ok, Bootstrap, Angular-Js, and all the libraries are really cool and are useful in designing a fabulous UI. They are helpful in creating responsive pages that will work on all the devices but this post is not about those. Nope. For the purpose of this post, all the external libraries and buzzwords you use to decorate your resume are useless. (Adding Angular JS in your resume for a Salesforce consultant position when you don't know workflows is useless too, just saying). Another comment I receive fairly regularly is that- there are a lot many things you cannot do on salesforce. Which is true but still annoying. While there are a lot many things you cannot do, there are still a lot of things you can still do. One of those things is stop being annoying. Moving on.

Salesforce is a customer-centric system, as such, a user is at the center of whatever you do. Whenever you design an interface on Salesforce you have to remember that- someone will be paid to use the thing for 8 hours a day. If you design bad user experience, their job will be harder and reduce productivity and usability. And one important trick to remember designing a form is- DO NOT LET USER SCROLL. Make sure your form elements are reachable by tabbing.

So with that out of the way, let us take a look at the four secrets you should know before designing a visualforce page

1. Separate your data from the background
This is a tip that was given to me by the director of a college play. You clearly mark the area on the stage where you want the audience to focus their attention.
By default, any web system uses white background and text in black. This form is consistent unless you are on the Dark side or environment-friendly when you will use black background over white text. But don't be google when it comes to displaying complex data on the page. All you need to do is clearly separate the data from the background, you can do that by adding a thin gray background to your text or, as Salesforce does it, place the data between neat equidistant lines. If you are not using sidebar and headers, do include SectionHeader on the page. Make sure you set your data in a way, it is clearly distinguishable from the background.

2. Give visual feedback whenever you are processing information
This is visualforce building 101, if you are using a tag from the family of Command and Action (e.g., apex:commandButton, apex:commandLink, apex:actionfunction, apex:actionsupport etc) you HAVE TO use the apex:actionStatus. Don't leave your user guessing if the button press worked or no. There has to be a visual feedback.
You could be extra quirky to indicate what is happening or give an error message. Shiva has a good code for the same, you can use his action status in your code.

3. Take an extra hour to fix the error messages. Keep them consistent. 
Salesforce provides different ways to display error messages. Some are field level error messages, others are page level error. When developing a custom page, spend an extra effort to make sure your error messages are consistent. If you have a server-side validation, make sure it is displayed alongside the field instead of the top of the page. Don't make the user scroll the whole page looking for the next error message. Remember, someone will be spending 8 hours looking at the page you are developing. The early they understand where the error messages are displayed, the quicker they will adopt.

4. Place the buttons on the bottom as well as the top of the page.
This is a common problem in the majority of the visualforce pages. People will provide multiple sections of a form and them make sure scroll all the way up to press submit. Bad idea. Also if the user wants to just fill the required fields and then submit- which is also ok, don't make them scroll all the way down to look for the submit. Be smart, place your button on top as well as the bottom. Besides, give the user a choice and they feel included in the design.

So in summary, design user-centric system that they can adopt faster and learn quicker. Most of the Salesforce implementation fail because users do not adopt the system as they should. Make their job easier, not harder. A twenty-year experience sales person should not be bothered to learn a new system just because his job wants him to, instead, design the experience so much friendly that the said person should pick it up on the job quickly.

Hope that helps in any future design you create. If you have any other tips, share in the comments below.
Ok. Bye. For now.

And in the mortal words of a immortal machine traveling back in time, I will be back.
Read More

 One of the early challenges that I faced while learning Salesforce, almost eight years back, is that it was too big of a cookie to eat. It still is. Salesforce Platform is huge- it has many products, integrations, different design patterns, different coding standards and Reid Carlberg is always experimenting with something next!!!. On top of that, new developers and admins are walking into the fold with their ideas of coding, the uncertainty of the job and a massive task at hand- learn this new technology that starts with a dot com. The task is daunting. 
Salesforce on its part is very forthcoming to help the community- with its trailhead, online videos, webinars, and certification programs. But too much information in itself is not a very helpful start of a career. At times like these- you sometimes wish, you could take a deep breath, pause, reflect and say - ok this is where I start.
That moment is exactly why the new book - Salesforce Platform App Builder Certification Handbook is written for. This is where you start- this book is going to do enough to get you started, your first gear, your first step, your first app. It is going to give you the taste of the whole platter that you have to consume, one bite at a time. This book is for the beginner admins who want to know if Salesforce is more than the keyword, this book is for the beginner developers who want to jump head-first into the platform and this book for the professionals who moved from different technology and have a lot to unlearn before accepting Salesforce.
In a way- this book is the second edition of the Developer Certification Handbook that was published in 2012- but since the exam has changed, so has the syllabus and so has the book. Salesforce Platform App Builder Certification Handbook is written in the pattern of the exam and is updated till Spring 16.  
It will help you to prepare for the platform app builder certification exam. We begin with designing the object model and look at the options for building page layouts. It will guide you through designing the interface while introducing the Lightning Process Builder. Next, we will implement business logic using various point and click features of We will learn to manage data and create reports and dashboards. We will then learn to administer the application by configuring the object-level, field-level, and record-level security. These and many other fundamental topics are in place for you to learn. By the end of this book, you will be completely equipped to take the Platform App Builder certification exam.
The book is out there for you to buy. 
This is where you start. All the best.
Read More

Man is a social animal, this was the first lie they ever told you in your history classes. If we look at the human history going back through the dark ages, we understand that man is anything but a social animal.
The agriculture revolution gave control of food in everyone hand and we started building societies, bringing people socially together. But when societies formed it brought all sorts of people together and caused all sorts of conflicts between them. Somewhere in the middle ages, few smart people realized this and decided to kick start a religious revolution. They established common guidelines for communities to work cohesively without stepping on each others foot. But they could not achieve this without control of information. With control comes fear and with fear comes faith. They established Churches, Mosques and Temples and controlled the information to reach heaven.
But the voices of dissident did not merge, not easily, they just were suppressed. A few kings got on to the idea and decided to infuse this religious fever in their governance model. The entire Europe was established on the principle. Now the religious revolution had fear, faith and power to do stuff. The voices of dissident were brutally killed and the fear increased.
As we entered the industrial revolution, fear gripped the nation and so did faith. Together they created a working class that dreamt of a better world. At that time, two teenagers were working on another Book that would rock the world, they were Karl Marx and Friedrich Engels. The book they authored was 'Communist Manifesto' and they formed the labour revolution.
The labour revolution gave power to the voices of dissident that were hiding till that time. The labour revolution and the religious fever gave rise to democratic system. People decided time was for change and a new form of system was brought out. The democratic system was gift wrapped to the citizens as a government of their own. It was a government that majority agreed. They elected representatives and send them in the parliament, not knowing that the game itself was rigged. These elected representatives worked for the greater good but they were part of the old system, were control of information was essential. This new system was using the same old principle of withholding information thus causing fear and faith among the masses. That gave rise of conspiracy theories and the voices of dissident were termed lunatic and unpatriotic. 
A young college drop-out was working his way to do something he never expected, this was Bill Gates and he was trying to sell a personal computer. When he introduced the concept of Personal Computing, people laughed at him. Why would anyone need a personal computer? They were happy with computers at universities and workplaces but computers at every home? That was madness.
But that madness ensured. Bill Gates (knowingly or unknowingly) kick-started a computing revolution (Although the credit for computer goes to Alan Turing, I personally believe that the idea of Personal Computer was introduced to the world by Bill Gates). Steve Jobs lost the race in computing but regained his spirit in mobile computing. Between them they brought the power of computing to individual people.
The voices of dissident now had a platform. A free and fair medium that was so vast that no one could control and thus the cloud was born. Internet revolution broke the backbone of traditional institutions that relied of information control. These institution are religious, corporations and even Governments.
The power of internet brought with him the Occupy Protests, WikiLeaks and many more to come. What does this mean for business?
It means we are standing exactly where Matthew McConaughey was standing on the Millers Planet in the movie interstellar. What we are seeing as mountains are waves, big tsunami waves and they are not coming towards us. Like the Millers planet, our world, everything we know is moving towards them. We have already started descending into the next phase in human social revolution.
The information is no longer controllable, the dissident voices are no longer silenced. The problems can no longer be put on back-burner. The governments are running scared, trying to control the internet but this is an illusion. Social Media and Cloud Computing are two by-products of this massive revolution. We are moving away from the traditional computing model. We are moving from the controlled model of dispensing information based on location and time. It can still be achieved and is required for security but that is just an illusion.
If your 'social media' strategy does not include 'listening' to those voices, you are being pulled near that wave. If your corporate strategy does not include social media you are being pulled into that wave. Your employees, your customers and your partners are on social media. They are carrying devices that could leak complaints about you at any given point of time. How far can you control them?
The changes internet revolution is bringing are disruptive. They are here to stay. Anyone who pretends otherwise is still believing the waves are mountains and very far away.
Of-course this article is completely speculative and has no real evidence but we have already seen the changes happening around. We can always pretend that nothing of that sort is happening and go back to our life.
But the world will keep on moving and with it bring a new wave of change. How far we prepare for that change completely depends on us.
Pic: Luis Llerena 
Crossposted from Linkedin
Read More
One of the most worrying aspect of an client engagement is what comes after the successful deployment.

In one of my previous role, I was asked out of the blue without any prior warning to deploy a large chain-set containing 19 objects, some close to 380 fields, with 9 interlinked-relationships. Along with that I was to cleanse the data from legacy systems that amounted to 6 digits of records. And all this without a proper plan (I was the one who was supposed to come up with a plan for this) and two days prior to my extended vacation for Diwali. And that too when my mom had promised to make my favourite sweets.

But even on that day, when I prepared the plan on the 14 hour train journey from Delhi to Pune and then successfully deploying the whole package after relishing on the sweets, I was not as worried as I always am when I am told to do a Train the Trainers session at the clients office.

It is always good to have a train the trainers session and a good company understands that. However when it comes to estimates for a proper train the trainers session presents with difficulty. First, if its an implementation to replace their existing system (or worst with no system in place and moving from the DREADED EXCEL Sheets) a week worth of training is never sufficient. Not to mention the Users knowledge of Salesforce in the first place is very less and then telling them about the brand new system that we have developed for their convenience.

The point is, the exercise is fruitless which worries me. At the end of the session the customer promises to hire a good admin or if they have an admin, he promises that he will get certified and ask others to get one too. Somewhere down the line, it fails, people get confused using the new system and get back to their DREADED EXCEL sheets. This problem happens with a lot of Foundation customers as well.

When Salesforce introduced Trailhead I rejoiced, finally, I had something that I could give my customers, end users, new admins that was cheap (free duh), effective and a fun way of learning Salesforce. All I had to do now is go to the train the trainer sessions and verify they have the necessary badges to show us.

The trailhead website is very neatly organized and is very easy to navigate. If you are new to Salesforce, you could start with the basics track. this trail leads through 6 steps of Introduction to the platform, Data Modelling, Data Security, Data management, Formula fields and UI customization.

Not only that but Salesforce has now released amazing trailhead modules from programming track too. There are two programming tracks one for visual app development and another for Programmatic app development. 

The visual app development track consists in tutorials for process automation, Salesforce 1 basics, Setting up Chatter and how to handle change.

Read More has a mind-blowing reporting structure but it limits on data that is available on the system. Can we report on Data that is not present in the system?
For e.g., in a time-sheet management system, can we identify the people who have not filled time-sheets for a particular day? Can we report on data that is not present in the system? Can we identify records that are not created?

There is one thing I have learned working on platform for last 7 years, there is No No answer in Salesforce. Think a little bit and the answer will reach you. It is somewhat like climbing mount Everest, can you do it? Sure yes, in how many days depends on how fit I am (or how crazy I am)

Ok that Everest thing came up because someone did ask me that a few weeks back, moving on. Someone did also ask me about creating a report on missing details and I gave it a thought. The short answer is Yes we can, the long answer is we write a Visualforce page, anyone can tell you that. But what I really wanted to do was create a reusable code that I could use for a generic tabular report component.

The code is fairly simple, the pseudo code for the code is.
1. Generate a set of String for Rows
2. Generate a set of String for Columns
3. Prepare a map with Key as Row+Column and store the data accordingly.
4. Create a Dynamic table on Visualforce.

Apex Class for the page

public with sharing class TabularReportController {
    public Set rows{get;set;}
    public Set Cols {get;set;}
    public Map dataMap {get;set;}

 public TabularReportController(){

  public string getURLParam(String paramName){
            return ApexPages.currentPage().getParameters().get(paramName);
 //Get the data for the rows
 public Map getrow(){
     return new Map([Select id, name, Accountid from Contact]);
 //Get the data for the columns
 public Map getColumns(){
       return new Map([Select id, name from Account]);

    //This is where the magic happens
 public void prepareDataForReport(){
     rows= new Set();
     cols= new Set();
     dataMap= new Map();
     Map columnsData=getColumns();
     Map rowData= getRow();
     for(Account a: columnsData.values()){
         for(Contact c: rowData.values()){
             String key=; //Key is the key in which we set the data that we want to display.
                //Do some hazy logic here. This is where the key lies, you perfom your calculations and simply prepare the data
                //For display
                //For this example I am going to check if Contact is related to account

Visualforce page for the code

 <apex:page controller="TabularReportController" sidebar="false">  
 <style type="text/css">  
      .Related {  
            background-color: #0B610B;  
            color: #FBF8EF !important;  
            background-color: #A4A4A4;  
 <apex:sectionHeader title="Documents" subtitle="Report"/>  
 <apex:form >  
 <apex:pageBlock id="TheTable" title="Are the Accounts and Contact related?">  
 <table border="0" cellpadding="2" cellspacing="2" style="table-layout:auto" class="list">  
      <colgroup span="2"></colgroup>   
      <thead class="">  
      <tr class=" headerRow">  
           <th class=" headerRow" scope="col" colspan="1">Contact</th>            
           <apex:repeat value="{!rows}" var="row">  
           <th class=" headerRow">{!row}</th>  
  <tbody >  
 <apex:repeat value="{!cols}" var="col">  
 <tr class="dataRow">  
      <td class="dataCell" colspan="1" style="white-space:nowrap"><span>{!col}</span></td>  
      <apex:repeat value="{!rows}" var="row" >  
&lt;!-- This is the Key, so to speak, for the entire page. Generating the key on the visualforce page --&gt;
      <apex:variable var="key" value="{!col}{!row}"/>  
      <td class="{!dataMap[key]}">{!dataMap[key]}</td>       

You can see the output of the report here

You can enhance the code using the same structure. Here are couple different thing I tried
  1. Adding a link to the data using wrapper
  2. Model window editing for the data
  3. Adding complex many to many relationships
  4. Plotting records that are not present

The list can go on.
Read More
Salesforce External Objects is a new tool that has caught my attention in recent times. Those who spend their day listening to words like REST, SOAP, Integration etc. the following information for you.

Salesforce External Objects is nothing but the out-of-box implementation of ODATA architecture. ODATA is a open-source data transfer standard backed up by the Empire Microsoft (they are good guys now). Instead of an architecture of sending messages back and forth using HTTP like REST, ODATA focuses on the content of the message over HTTP. ODATA can also be compared with ATOMPUB format (RSS feed format). However ODATA is useful in sending tabular or data over HTTP, that example can also be sorted, searched, filtered and other URI conventions.

In this second post on Lighting series I am going to delve deep into how Lighting Connect lets you access external data right into Salesforce. If you were living under the rock or in some place with no internet connect, here is the summary of what you need to know about Salesforce Lighting.

In this hands-on I am going to pull some real time data into Salesforce.

Step 1: First thing we need to find out what external databases are available for us to connect to. Salesforce supports ODATA V2 databases. A quick google search brought me to this page that has some live example. (

Step 2: If you go to Services on the site, you will find OData (read/write) that is online.
The link opens a URL ( hold on to that for now, lets open Salesforce.

Step 3: As always login to your developer account. (Note: for this tutorial and any tutorial on Lighting, please get a fresh org. As I learned the hard way, an old sandbox did not have this feature in built.)

Step 4: If all is well, you will find External Data Sources and External Objects

Step 5: We are going to first add an External Data Source and point it to the OData. Go to External Data Sources -> Click 'New'

In the form you can specify the Name and Label. The Type should be Lighting Connect: OData 2.0 

Step 6: Once you select the type, it will have further fields like Server URL. Copy the URL we have in Step 2 above and click Save.

Step 7: Once you click Save and all is well you should see a detail page with options to Edit, Validate and Sync and Delete

Step 8: Click on 'Validate and Sync' it will scan the URL and get you all the objects available to Sync with Salesforce. Note: if it does not sync or you get an error, it will be shown in Status field.

Step 9: I am going to select Product object to sync. Select your objects and click on Sync. You should see one record in the External Object section.

Step 10: Now comes the best part, go to Create-> Tabs and you can find our objects right there in Salesforce object tabs

As I have understood in past few days, Lighting is a vast thing. In the next few weeks, Ill be posting one blog about the Lighting Framework. Be sure to subscribe to the blog and if you have any comments, mention in the comments below.

SforceNinja Out.

Read More

The first computer I ever saw in my life was a desktop that my father gifted to me during my second year of computer engineering. The specifications were a 1 GB of RAM, 40 GB HDD, a modest LG monitor, an Intel P5 Dual Core processor and an Inverter (this came separately and since we were in India, a battery inverter was necessary). The installation was so space consuming that we had to invest in a computer table (no other place could accommodate this machine) that had options of keeping CPU and inverter and Printer under the table, a foldable keyboard and mouse holder and a monitor. This was ten years ago and by the standards back then, my father had purchased the best computer in town.

My father is a perfectionist, and hence he insisted on building a shelf/ library over the table that would complete the look of a decent computer workstation. This was the computer that accompanied me during my engineering days. The endless hours spend over playing with MS Paint, writing hacks in Excel and sending it to friends. I used to write first draft of my stories on the machine, I used to listen to songs for endless hours. Purchase DVDs and listen to them until they are scratch. I had 9 pen drives, with which I used to carry my data to my college.

The last three smartphones I had support 64GB of memory space. They all had Quad Core processors, were much faster than my computer and could fit in my pocket. The things that I did with my computer, now I do with my phone but I do it without getting chained to the workstation. I play my favorite GTA Vice City, over again on my phone. I left my home town around eight years back and have been travelling since. Carrying a phone with me was much easier than carrying the machine. I remember having 12GB of songs on my Computer. Now, I use the paid service of, the online music station. And you know what? Even while travelling on the cold foreign streets of London, the friendly voice of Arijit Singh accompanies me. My data is safely backed up on cloud servers and not just mobile data. The old college files, the projects reports everything.

My brother called a few days ago and asked me if he can sell the computer and buy something new. That call provoked this post. I sold the computer and have moved on.

Because many people asked for it, updating the post with the common task I needed computer for that have been replaced by the cloud.

1. Editing my Book

Thats the easiest thing anyone can relate to. How do I create documents, the dreaded excel sheets and powerpoint presentation. The common answer would be Google Docs but somehow in past few days, I am not really in Moodle for Google (neither am I switching back to the old nemesis microsoft). I used Zoho Writer to edit my novel online. I preferred their services much better than other online tools.

2. Create Graphic for the blogs

Creating graphics is as old as computer itself. And when it comes to creating graphics, no one does it better than Photoshop. Photoshop was hard to replace but two services have given me more joy that anyone ever could. One is and Canva. Canva helps me layout stuff with text, like the title graphic of the blog while lets me create and filter images easily.

3. Creating presentation

When I am not doing anything, I am busy creating presentations. I love those things that move around. You can see some of the things I created on my site showcase. Most of the presentations on the page are created using the online 3D presentation maker. Prezi gives an extra dimension to the presentation and that wow factor helps.

4. Making Infographics

I have used many corporate tools for making infographics. The best one was obviously illustrator, adobe knows how to do stuff right. But then can I make infographics online? I tried with pixlr but since there was a screen limit with their editor, making a long infographic like the one for cloud computing was a tedious job. Just when I thought, I am losing the challenge, ta da, came to the rescue. Cacoo has an easy to use interface where you can create beautiful graphics for free. They offer 25 diagrams on the free license which is really cool.

5. Sharing files and photos

One of the many things you need a computer and those little USB drives is transfer of files. During my college days when I did not have a computer, I used to carry a rewritable CD in my bag and borrow CD writers on my friends computer to burn disc. Things changed and we now have those USB drives. So the real question here was how do I transfer more than a GB of file? Now in real world scenario there are very few things that are more than one GB, however lets say I wanted to transfer a heavy file? And there Dropbox came to rescue. What was more with the camera upload feature, I did not have to do anything. When I took photos, they were safely upload to dropbox and all I had to do was share it with my friend.

6. Watching Movies

When was the last time you stepped into a DVD store and purchased a nice DVD, picked up a bottle of whiskey and made some pop-corn. If you never did, I highly suggest you do. Anyways, so since this was a post computer world, the best alternative I found online was It is a on-demand movie site that streams bollywood movies. It also streams selected english movies. I recently got a subscription for NetFlicks which streams English films and serials.

7. Listening to Songs

Listening to songs while doing stuff is one of the many things one can do. However, iTunes has already brought those on cloud. Just like movies, listening to songs is also a regional thing. One of the best service I use regularly is It streams not only bollywood but also regional marathi songs. For Internet radio and songs I switch between Spotify and Pandora

I am the monk who sold his computer for the Cloud. Are you?

Image Credits: Flickr (CC Label for Reuse with Modification)
Edited Using:
Read More
Previous PostOlder Posts Home