Getting started with React

React is open source Javascript library used by Facebook and currently very popular amongst web developers to create user interface. React can be used as View part of MVC design pattern with powerful templating feature supported by “JavaScript syntax extension (JSX)“. React focuses on component based development where each components has its own life cycle. Once of exciting behavior of React is its unidirectional data flow from Parent to child components. React is different than AngularJs in such a way that React passes data in unidirectional however in angularJs data must be available to $scope variable (bidirectional binding). Reusable components in AngularJs should be created as Angular directive however in React every component can be reused.

React Javascript library by Facebook

React Javascript library by Facebook

In this article, I will show very simple Hello world program using React framework.

<html>
	<head>
		<script src="http://fb.me/react-0.13.1.min.js"></script>
		<script src="http://fb.me/JSXTransformer-0.13.1.js"></script>
	</head>
	<body>
		<div id="main"></div>
		<script type="text/jsx">
			var HelloWorld = React.createClass({
				render : function(){
					return (
						<h1> Hello World</h1>
						);
				}
			});

			React.render(<HelloWorld/> , document.getElementById('main'));
		</script>
	</body>
</html>

Output : Hello World in h1 tag. Continue reading

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

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

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

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

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

Salesforce FAQ – Part 20 – Lightning Questions

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

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