Delete Components using Ant Migration tool – Video

This video tutorial shows that how we can delete components like Apex class, trigger from Salesforce using ANT migration tool.

I have posted multiple basic and advance articles about using ANT or ANT migration tool with Salesforce. Some of most visited articles are :

Going through multiple comments, I decided to create this 5 minute video tutorial to demonstrate, how we can use DestructiveChanges.xml in Ant migration tool to delete components.

As known already, we cannot simply delete components from Salesforce production using changeset. Apex classes, triggers etc cannot be deleted manually as well.

subscribe to Youtube channel, to get notifications about new Salesforce videos.


How to setup Git Server using Bitvise SSH

Step by step guide to setup Git Server using Bitvise SSH Server

Recently for one of client, I was in need to setup Git on their intranet. Being healthcare industry and compliance issue, source code could not leave company network and therefore needed in-house solution for Source Code Management (SCM) and automate builds.

In this blog post, I will explain how did we setup Git server that is accessible from anywhere in company network.

We need below two software installed on system which will act as a Git Server.

  1. Git (Free)
  2. Bitvise SSH Server (Paid )

First we need to install Git on server and add path of “git.exe” in environment variable, so that we can use git command from console.

Next, we need to install Bitvise SSH Server and set it up. Once, Bitvise SSH Server is installed, we need to follow below steps.

Step 1: Open Bitvise SSH Server control panel as shown in below image

Bitvise SSH Control Panel
Bitvise SSH Control Panel

Continue reading “How to setup Git Server using Bitvise SSH”

New Trail in Trailhead – Navigate the Salesforce Advantage

Navigate the Salesforce Advantage – New learning module and project added to Trailhead

Its not too long when Trailhead was announced in Dreamforce, who have though that it would be integral part of learning for Salesforce developers, admin, business analyst and even customers ?

Trailhead recently released new trail Navigate the Salesforce Advantage for readers, who want to know about Salesforce, its culture and what makes it outstanding and different from other technology companies.

Below are list of modules released as a part of this trail and topics it covers : Continue reading “New Trail in Trailhead – Navigate the Salesforce Advantage”

Creating custom ANT plugin or Task in Java

Tutorial to create custom Task in ANT with complete source code

ANT is very powerful and one of the most used tool in Java and other platforms like Salesforce. In Salesforce, ANT is officially used to deploy changes on instances using Metadata API. It is also integral part of Continuous Integration. Even though, there are hundreds of libraries and ANT Tasks are available to use, however there are many scenarios where we need to create our own custom Task.

I am using many custom ANT tasks in my projects and its very easy to create. For example, I have created automated data load process with custom ANT task, which is almost as powerful as of any paid ETL tool.

In this blog post, We will go through creation of very simple ANT plugin. We will create a custom ANT Task with nested tags , attributes and then print it on console. It shows that, we can read attribute passed in build.xml. if we can read attribute, then writing any custom logic is not a big deal. Continue reading “Creating custom ANT plugin or Task in Java”

Responsive Datagrid component in Lightning – Basics

This blog post explains simple use case of Nested Lightning Component. It goes through example on how to interact and combine nested components to be used in parent Lightning component.

This is a first blog post of a series, to develop advance lightning components and understand various features offered by Salesforce Lightning Platform. This post will explain why do we need nested components and how do they communicate.

At first, nested components looks like displaying something in child component and wrapped in parent component. However, to make most of nested components and designing efficient Lightning components, we should use nested component only to define set of rules. Unlike components in Visualforce, where we render some reusable output on page, Nested components in Lightning defines set of attributes to be used by parent component.

Hard to digest and imagine ? Please read on this post, you will understand concept soon. Continue reading “Responsive Datagrid component in Lightning – Basics”

Disable “Pull to Refresh” in Salesforce1 for Lightning Components

Why Renderer is important in Lightning Components. Best practices to follow and use case example of using Renderer methods in lightning components.

Chances are very high that most of you already know why do we need controller, helper, style and component resources in Lightning component. Renderer is one of the overlooked and very powerful  resource (feature)  while developing Lightning components.

We can use renderer functions to dynamically change components look and feel and tweak its behavior as well. You might not need this Renderer resource at all until, you are working on some advance component or run into problem as discussed in this post.

Basically, Renderer consists of following four methods:

  1. render()
    • This method returns html element from DOM hierarchy.
  2. afterRender()
    • This method executes when html element (DOM node) is rendered in browser.
  3. rerender()
    • This method executes when component is changed. for example, if any attribute is changed on component then this method gets executed.
  4. unrender()
    • Whenever component is destroyed from browser’s DOM hierarchy, this method gets executed.

Continue reading “Disable “Pull to Refresh” in Salesforce1 for Lightning Components”

Dynamically Instantiate and destroy Lightning Components – Modal dialog component

Learn how to create advance lightning component (Modal dialog) and dynamically instantiate and destroy it

This blog post focuses on how we can create Modal Dialog component in Lightning and dynamically instantiate and destroy it on button click event as shown in below image.

Salesforce Ligtning Modal Window
Salesforce Ligtning Modal Window

Continue reading “Dynamically Instantiate and destroy Lightning Components – Modal dialog component”

Test Setup method in Apex

How to use setup method in Apex test classes

In previous blog post, we discussed best practices of writing Test classes in Apex. In old school way, if we wanted to create records for test methods, helper or utility classes were favorite option for developers.

However this approach has few disadvantages

  • Multiple Test classes could depend on these utility methods
  • It creates tight coupling between classes
  • Deployment could be slow if unnecessary test record being created for test methods
  • If class to create test record is not marked with @isTest then it will count against allowed apex code in instance
  • Test classes needs to explicitly call method to create test records

Continue reading “Test Setup method in Apex”

Spell checker in custom Visualforce page

Using Salesforce Spell checker in custom Visualforce pages

Standard email functionality in Salesforce supports spell checker out of the box. These days, all modern browsers already has spell checker and customer may agree to use it. However there are some customer, who wants standard look and feel of application include spell checking.

We might be in need to create a custom Visualforce page with spell checker functionality same as of out of the box. Salesforce does not support it in custom pages and there are no pure JavaScript based libraries available to support spell and grammar checking. JavaScript libraries, I have seen, needs to access server side endpoint implemented either in PHP or any language. We can try to use those libraries, however we need to use AJAX request to get spelling and grammar suggestions. Continue reading “Spell checker in custom Visualforce page”

Storing secrets or passwords using manage package in Salesforce – Video

Designing application to store passwords or secrets in Salesforce using Manage packages

Salesforce supports Encrypted Field out of the box on standard or custom objects. However, users with appropriate profile or permission set can easily view content of those fields. If we want to store secure information like passwords (of external systems), then there is no direct way to achieve this. If we think about passwords, no one should be able to view it. If we forget password, then instead of system sending old password, it forces us to reset it.

We will create same behaviour in Salesforce where stored password cannot be viewed by anyone.

Storing Passwords in Salesforce
Storing Passwords in Salesforce

Continue reading “Storing secrets or passwords using manage package in Salesforce – Video”