Getting started with basics of Lightning Component

As you might already know that next big change in Salesforce is introduction to lightning components. As technology is changing rapidly and to take advantage of cutting edge innovations in web technology, Salesforce doesn’t want to stay behind. If we see trend, all major platform has introduced component based design like Polymer, React, Web Components, Angular 2.

We will be discussing basics of Lightning components in this post and how Lightning application, component, controller, helpers and Apex controllers are connected with each other.

Lightning components are based on open source UI framework for web development. Every Salesforce organization already has aura documents available in their instance and can be opened by navigating to http://instance.salesforce.com/auradocs. You can also visit my other blog post explaining FAQ of lightning and Lightning Trailhead module.

In below image, I have tried to explain at high level, how different JavaScript files are related in Lightning components, there are many other parts as well, but I tried to keep it short and simple.

Getting started with lightning components
Getting started with lightning components

Continue reading “Getting started with basics of Lightning Component”

Using Dataloader and ANT to backup Salesforce data on FTP or SFTP server – Video

Tutorial on how to use command line dataloader to save exported Salesforce backup file on FTP or SFTP server

We will be using command line dataloader from Salesforce and ANT script to extract data from Salesforce and backup on FTP server. I would recommend to go through this article first to get familiar with basics of commandline dataloader and followed by this article to get some insight that how we can use ANT with dataloader.

There can be hundreds of use cases where we need to backup data from salesforce and we have thousands of options. We can use Jitterbit, Mulesoft, Dataloader.io or some big ETL tools like BOOMI or informatica. However sometimes clients are not willing to pay hefty  amount on licensing cost of ETL tools and I love open source. In this article, we will be using open source solution to very common problem of backing up data on FTP server.

Complete code is available on my github account as well in case you need it.

Use Dataloader and ANT to back CSV file on FTP Server
Use Dataloader and ANT to back CSV file on FTP Server

Considering you know how to use command line dataloader, first challenge would be how to get it worked using ANT. Below code snippet show how we can create ANT macro to invoke dataloader to extract data. Continue reading “Using Dataloader and ANT to backup Salesforce data on FTP or SFTP server – Video”

Using Selenium to test workflow field update action – Salesforce automated testing – Video tutorial – Part 2

We have already discussed basics of selenium and how we can use this tool for automated testing. Here we will see how we can take advantage of Selenium to test workflow field update. in this article we will create a simple workflow rule on Lead object and update “Description” field by adding fields “Number of Employees” and “Number of Locations”. We can use selenium to test if workflow is working or not ?

Salesforce Workflow rule - field update on Lead
Salesforce Workflow rule – field update on Lead

Continue reading “Using Selenium to test workflow field update action – Salesforce automated testing – Video tutorial – Part 2”

Create and update records using Javascript button in Salesforce- Ajax Toolkit

On this blog we have already seen “how to use Ajax Toolkit to mass update records” without writing any Apex code. In this article as well, we will use Ajax Toolkit to add custom button in Account page layout and update record.

There are endless possibilities and use-cases where this approach can be very useful in Salesforce projects and can be accomplished by Salesforce admins. Lets say we want to create child record on click of button, Update current record on basis of some logic, Update hidden fields, execute existing Apex code using Javascript and so on. All of these can be implemented wthout writing single line of Apex code, Trigger or Visualforce pages.

In this post, we will add custom button on Account detail page and execute Javascript to update Account name using Ajax toolkit. This is just proof of concept and any other field can be updated.

Creating Custom button :

Navigate to “Customize | Accounts | Button, Links and Actions”.

Create new button of type “Detail Page Button” , behavior “Execute Javascript” and content source “Onclick JavaScript”.

Update Record using Javascript

Update Record using Javascript

Continue reading “Create and update records using Javascript button in Salesforce- Ajax Toolkit”

Selenium and Salesforce – Salesforce automation testing – Video tutorial – Part 1

This is first post of multi-series article on using Selenium with Salesforce for Automation testing. Testing has always been integral part of any software development life cycle and Salesforce has already taken it to next level by making mandatory to have 75% of code coverage before any code deployment. These apex test classes, however has its limitations where we can only test Apex code written. I have seen most of Salesforce project ending with manual testing. Audience for this series is not only developer but Salesforce admin and of course manual testers as well and please feel free to drop comment throughout this series if I left any area or topic uncleared.

What is Selenium 

Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese)[1] to write tests in a number of popular programming languages, including Java, C#, Groovy, Perl, PHP, Python and Ruby. The tests can then be run against most modern web browsers like firefox, Chrome, Internet explorer. Selenium deploys on Windows, Linux and Macintosh platforms.

Selenium and Salesforce
Selenium and Salesforce

Continue reading “Selenium and Salesforce – Salesforce automation testing – Video tutorial – Part 1”

Using CCTray to monitor continuous integration setup using Jenkins for Salesforce | Video Tutorial

In previous article, I have explained that how to use Jenkins to setup Continuous integration for Salesforce.

Now, once Jenkins is up and its doing its job to build Salesforce changes. Next task is to monitor build result. We already setup post deployment task by creating chatter message to notify everyone about build result, however there is one more excellent way to be aware about result and its small desktop client named “CCTray”.

You can download CCTray from here. Once installed, follow below steps to setup.

Open CCTray and navigate to settings :

CCTray Settings
CCTray Settings

Continue reading “Using CCTray to monitor continuous integration setup using Jenkins for Salesforce | Video Tutorial”

Continuous integration in Salesforce Using Jenkins and Git | Video Tutorial

As your Salesforce Organization undergoes heavy customization and frequent builds, moving changes from one Sandbox to other sandboxes starts taking longer time and effort. Also, in normal Salesforce project, there are chances that you will have minimum three sandboxes likely Developer Sandbox, QA Sandbox and UAT Sandbox. After some time you will be in need of some solution which can reduce your effort.

Almost 5 years back, when I was working on .net along with Salesforce, I posted article on Continuous Integration of ASP.net and subversion as a code management with MSBuild on code project.

This time its Salesforce using Jenkins. In this article I will walk through solution of above problem using Jenkins. Don’t forget to watch Video at end of this article, where I provided demo of everything explained in this article.

Prerequisite Software:

  1. ANT
  2. Salesforce Migration Tool
  3. Git
  4. Eclipse or PuTTYgen to generate SSH key

I am assuming you already know about below concepts:

  1. How to use Git with Salesforce
  2. Using ANT migration tool in Salesforce
  3. Generating SSH key
  4. Automated Daily Backup of Salesforce Using ANT Migration Tool and GIT (Optional)

I will suggest to get familiar with first three topics before jumping to Continuous Integration.

There are two ways to start working with Jenkins

  1. Install Jenkins on your local system
  2. Use Cloudbees online

Below diagram shows complete flow of Continuous Integration we are going to setup in this article.

Continuous integration in Salesforce Using Jenkins and Git
Continuous integration in Salesforce Using Jenkins and Git (Bit Bucket)

For this tutorial, I will install Jenkins on my local system. To install it, Navigate to Jenkins homepage and download installer. Continue reading “Continuous integration in Salesforce Using Jenkins and Git | Video Tutorial”

Learning Lightning Component – Trailhead way

Learn Lightning Component Trailhead way
Learn Lightning Component – Trailhead way

In Previous article, I have introduced what is Trailhead and why employer should start using it to train Salesforce developers and Admins. At the time of writing this article, there are already 16 modules to be learned from it.

Recently Salesforce has added some more awesome tutorial and  In this article, I will walk-through “Lightning Component” module of Trailhead.

1. Getting started with Lightning Component (+100 points)

In this module, you will learn that what exactly is lightning component, Aura Framework and how it is different than visualforce?

This is UI framework to develope dynamic web pages for mobile and desktop devices in Salesforce. Its used mostly for SPA (Single Page Applications). It focuses on component based developement and reusing it. You can compare Lihtning component (by Salesforce) with React (by Facebook) and Polymer (by Google).

Continue reading “Learning Lightning Component – Trailhead way”

How to start learning Salesforce – Trailhead is good answer

In last 3-4 years, Salesforce is well known cloud computing platform between IT professionals and fresh college graduates. Dreamforce, well known for largest conference on planet breaking its own record every year. Salesforce is also top Innovative company in world as per forbes.

Change is inevitable – well adapted by Salesforce. Unlike traditional languages, Admins and developers needs to be updated every four months with each release. Many system limitations we know get addressed in next release. It has many products like Sales Cloud, Service Cloud, Force.com, Data.com, Marketing cloud, Analytics cloud and very easy to lost in those sections.

I been working on Salesforce from last 6 years and questions regarding how to start with Salesforce is increasing day by day.

Salesforce knows that “With great power comes great responsibility” and they already started to address this Developer/Admin adaption problem with introduction of Trailhead.

What is Trailhead ?

In my words, “Trailhead is innovative training application developed and maintained by Salesforce which supports realtime module assignment validations and Trailhead badges on public profile”. It is getting updated with new contents and challenges frequently.

Why should our company start using Trailhead for training and why buzz every where ?

It checks module completion exercises realtime using ToolingAPI to confirm if trainee has really completed assignment or not? After completion of each module user will be awarded with points which will be visible on public profile.

I would suggest everyone who wants to learn Salesforce to complete module and showcase their Trailhead profile as a proof confirming completion of modules.

Questionnaire at end of modules

This is recently added modification Salesforce team has introduced in Trailhead. Who doesn’t likes to validate their understanding ? At end of each module, now we have to answer questions to earn points of modules, and it supports multi-choice also.

Continue reading “How to start learning Salesforce – Trailhead is good answer”

Salesforce interview question related to Lightning framework – Part 20

Salesforce interview questions for Salesforce developers and admin , mostly related to newly released Salesforce Lightning components and applications

191. Why do we still need Visualforce once Lightning will be GA ?
Ans : Visualforce provides the facility for delivering template-driven web pages and email messages. In addition, developers wishing to simply utilize a basic container and maintain more control over the lifecycle of the request may choose Visualforce pages. Finally, organizations that can’t use Apex code can’t use Lightning Components, but they can use Visualforce.


192. What is difference between Visualforce Components and Lightning Components ?
Ans : Visualforce provides the facility for delivering template-driven web pages and email messages. In addition, developers wishing to simply utilize a basic container and maintain more control over the lifecycle of the request may choose Visualforce pages. Finally, organizations that can’t use Apex code can’t use Lightning Components, but they can use Visualforce.


193. Currently, can you show Lightning components tab in Mobile as well in desktop ?
Ans : Currently you can only use Lightning Components in the Salesforce1 Mobile App or a standalone app. Continue reading “Salesforce interview question related to Lightning framework – Part 20”