Saturday, August 17, 2013

Sneak Peek: Checkpoints (a.k.a. Simulated Breakpoints)

Simulated breakpoints a.k.a. checkpoints enable developers to assign breakpoints to assess stack values at that point of execution.

Simulated breakpoints are available in new Developer console. 

At many occasions developers need to assess variable/ instance values during execution. This comes in very handy especially when debugging something in production wherein developers cannot add "system.debug" statements at their will. With breakpoints, developers can very well place breakpoints at desired code locations and execute the code to get breakpoint results

To create checkpoints, open a class/ trigger in developer console and click on left hand side (just next to line no.). Once added, you can view your breakpoints in "Checkpoint Locations" sub tab within Checkpoints tab. 
Each execution of class/ trigger generates Checkpoint data in "Checkpoints" sub tab. Double click on the individual checkpoint log, to view corresponding heap dump and memory details.

Very interesting. Isn't it. 

Overlaying Apex Code and SOQL Statements

That's not all. In addition to viewing heap dumps, Checkpoints enable developers to inject anonymous apex/ soql code during execution and the corresponding logs are displayed accordingly (log for apex code gets displayed in debug logs along with other details and results for SOQL query injected gets displayed within checkpoint details). This can come very handy while debugging production issues

Additional reads:-

Wednesday, July 3, 2013

Quick Tips: New improved Salesforce Data Import Wizard

Finally, there are few much needed feature additions to Salesforce's data import wizard. 

Note: The Data Import Wizard is currently available through a pilot program.

On a high level, I found following improvements:-
  1. Improved UI (bit glitches though) with wide screens having lesser height
  2. Data mapping on the fly
  3. Drag and drop file (thanks to HTML5)
  4. Specify actions for e.g. insert, update or both
  5. Capability to skip trigger execution for data being imported
  6. Improved data mapping with ability to map a column from data file to multiple properties
Following is step to step procedure to use it (simplistic flow):-
  • Open wizard
Salesforce Data import wizard Step 1
  • Select object, action and provide data file
Salesforce Data import wizard Step 2
  • View/ modify data mapping
Salesforce Data import wizard Step 3
Salesforce Data import wizard Step 4
  • Review import information and confirm
Salesforce Data import wizard Step 5

Sunday, June 23, 2013

Sneak Peek: Publisher Actions

Extends chatter's capabilities to enable user to take custom actions for e.g. create a new related record or access a visualforce page.

It would be accessible via chatter section on Chatter tab, home page or chatter section in detail page of an object.

Publisher actions lets administrator/ developer expose additional functionalities to users via chatter feeds. So, now a user can create a new record from chatter feed as he/she used to create new post/ poll etc. For e.g. a user viewing account detail page can create a contact/ opportunity related to the Account, without navigating to any other page.

Actions can be created from Object setup page or via "Buttons Links and Actions" link for each standard object in Setup and Administration section.

There are two types of actions:-

  1. Create action:- allows user to create a new record. Administrator can define the fields to be displayed in the create page layout. Additionally, administrator can specify default values for certain fields.
  2. Custom action:- allows a visualforce page to be displayed on click of action.

Each type of action can be set as:-

  • Global action:- action not specific to any particular object and hence is accessible via Chatter tab, home page etc.
Salesforce Global Action

  • Object specific action:- action specific to an object and hence would be displayed on chatter section of object's detail page

Salesforce Publisher Action

For more details, please refer to:-

Friday, June 14, 2013

Sneak Peek: Salesforce Polymorphic keys

Polymorphic key is a relationship field which can relate to more than one type of object as parent. Unlike Lookup and Master-detail relationships which are related to a single object, Polymorphic keys can refer to multiple objects.

As of date, Polymorphic keys cannot be created by developers. They are available for specific objects out of the box for e.g. WHOID and WHATID in Task and Event objects.

Sneak Peak: Salesforce Polymorphic Keys
As we know, Salesforce’s data model is strictly relationship based, and the type of objects at both the ends of the relationship is fixed. So, if an object is to be related with multiple objects, then a separate relationship field has to be created for each relationship. Polymorphic keys are required to maintain relationship with multiple types, for e.g. task/ event might be related with various type of records viz. Account, Contact etc. So, a polymorphic key helps in establishing unique access to such disparate relationships.

Polymorphic keys are hard to handle!! As they are polymorphic the queries/ data manipulation can be tricky, as the related object can be anything, and hence the operations might or might not succeed. For e.g. functionality to update a field on Account may not work with Contact.

In order to implement such functionality, the type of the object is to be determined and hence the operations are to be applied. Further, the objects would need to be retrieved separately.

With Summer ’13 release, Polymorphic keys have become more friendly. They can be used in SOQL queries to filter out specific types, based on type specific filter criteria. Following are few ways of handling polymorphic keys in SOQL:-

List = [SELECT TYPEOF What WHEN Account THEN Phone WHEN Opportunity THEN Amount END FROM Event];
This would conditionally return value of field "Phone" if event is related to Account and value of field "Amount" if event is related to Opportunity

Note: TYPEOF is currently available as a Developer Preview as part of the SOQL Polymorphism feature.

Filter results by Type
List = [SELECT Description FROM Event WHERE What.Type IN ('Account', 'Opportunity')];
This would return only those events which are related with an Account or Opportunity.

For more details refer

Wednesday, June 5, 2013

Sneak Peek: Salesforce Permission Sets

With permission sets available for some time now, there have been lot of discussions around what is real use of permission sets, what they are capable of, when to use them and when to stay away from them. I am hereby trying to put in some views

A Permission set is a configuration based mechanism to provide additional capabilities to users, on a temporary basis. It can be viewed as a subset of Profile, wherein it has similar capabilities to define security permissions, but has few lesser options.

Permission sets should be used primarily for temporary basis, wherein the access is to be provided for shorter time duration and the access can be removed later. 
It can however be used to provide additional access to certain users, as compared to other users using same profile. But, in this case, usage of permission sets is elongated, its suggested to rather create a new profile.

It provides a very flexible and easy approach to give additional permissions to selected users, hence not impacting other users. One interesting feature of Permission sets is that they can be defined without specifying any license i.e. they can be assigned to any user having any license. Something, not there in profile.

vs. Profile?
  1. Permission set can add specific permissions to specific users
  2. Permission set can be defined independent of license type hence are highly reusable
  3. Multiple permission sets can be assigned to a user

For more details on permission sets visit Permission Sets Overview.

    Saturday, June 1, 2013 : Cool features of Summer ‘13

    Following are few cool features released in Summer '13 release of

    Salesforce Communities
    It’s probably one of the most awaited features. It replaces customer and partner portals and brings a consistent user experience for internal and external users. It brings more flexibility to bring interaction with customers and partners. Additionally, it provides seamless access to chatter adding social quotient to customer/ partner communication. Canvas – Generally Available
    Canvas as you would have already known, is a feature to enable access to business specific web applications from within Salesforce. Although, this might not seem interesting in start, but, many organizations have needed it since a long time to provide unified access to multiple applications. This makes application discovery easier and uniform. Also brings seamless access to all applications.

    Opportunity Split
    In real time scenarios, mostly multiple people are responsible for winning a deal (off course not when the salesmen is a Hollywood star). In such scenarios, in past, custom development had to be done to split commission across various people involved. But, now it comes out of the box. So, kind of nice, as it can avoid a lot of fights and grudges when a deal is “closed”.

    Customizable Pricebooks
    Yes, this is really true. I have personally faced a lot of issue with Salesforce pricebooks. It looked like a sacred turf, only meant for Cricket or Football players and not for rookies like us . Now, it is almost a level playing field. Pricebooks can now be customized with new fields, triggers, page layouts and validation rules. Additionally, you can also report on pricebooks. Isn't that savvy!!

    Metadata API changes – New Metadata types
    This is again a very fantastic addition. This means that new elements like  ApprovalProcess, ForecastingSettings,  LiveAgentSettings, SamlSsoConfig etc.  are exportable just like other metadata elements and can further be deployed to production without having to be created manually, as in past. So, a whole lot of new elements available for automated deployments.

    Dashboards in Touch on iPhone devices
    It can literally fit into your palm. Indeed, a very “handy” addition. With this addition, Salesforce users can now access dashboards on their mobile devices. So you get analytics on the run.


    I want to showcase a new application I have created. This is a simple application which enables tablet users to view their open tasks and manage them. The application is designed to be intuitive and user friendly and provide simple but effective process flow.


    1. Implementation of jQuery Mobile with Visualforce
    2. Google maps with driving directions
    3. Signature capture via SignaturePad (jQuery based plugin).

    Following are the screens of the application:-

    1. Task List
      • Grading of tasks based on current week, next week and future tasks to prioritize based on their due date
      • Displays only open tasks
    2. Task Detail
      • Displays task detail
      • Fields to be displayed can be managed via fieldset, hence can be customized by admin
      • Displays account location on google maps and suggest driving directions
    3. Close Task
      • Ability to close task in one click
      • Ability to capture customer signature while closing task
      • Just a small app. Hope you like it.

    SOQL + Geolocation = Proximity Search

    Well at last, there is something I am really cheerful to write about (there have been other things, but sometimes I was busy, other times it was not this exciting).

    The other day, I was looking at a project requirement, wherein we need to filter certain records based on their proximity to a certain location. As per current features, you’ll have to pull all relevant records and then calculate the distance between the desired location and record’s location and then determine its proximity.
    Now, with Summer ’12, SOQL has been equipped with two new powerful functions, which would help you in doing just the same, without even getting into nitty-gritty of proximity calculation.

    GEOLOCATION is function added to convert a given Lattitude-Longitude to a gelolocation.

    DISTANCE is function added to calculate distance between two geolocations.


    Popular Posts