Sunday, December 3, 2017

Building blocks of a Customer Relationship Management (CRM)

In my previous post, I covered a basic introduction to Salesforce. I would recommend going through it, if you are not already aware of Salesforce!

It's important to understand what makes up a CRM, to better understand Salesforce. So, in this article I am going to cover the basic building blocks of a CRM.

Imagine, yours is an Organization which sells Electronic Items to the Electronics Stores. Your sales officials have this responsibility of contacting the Electronics Stores in the area, and they are currently maintaining the stores' information in their own hand-written Notepads (old school way of managing the information) or in an Excel sheet (a little better, but not in Today's world).

If we make the best use of technology available today and create a system for the Sales Representatives using which they can store, manage & retrieve the information of their customers or potential customers in an even better and efficient way, that would be our Customer Relationship Management (CRM) system.

Formally said, CRM is an approach/strategy of managing a company's interaction with the customers and potential customers.

There are plenty of CRM software available in the market today. You know one already (Hint: Salesforce 😉)! Others include Microsoft Dynamics CRM, Zoho CRM, Sugar CRM, etc.

Although the basic structure of every CRM system remains the same, but I will consider Salesforce as the base for this post.

Objects in Salesforce
Think of Salesforce as a database where you have several Tables to store information in. The tables in Salesforce terms are called Objects. Every row/entry in the table (or, object) is termed as a record of that object. Easy to understand this way. Isn't it?

Now Salesforce being a CRM, creates some tables objects for you to use directly. Of course you have can extend that table object, or create a new table object (urgh! it's object in Salesforce. You got that, right?).
The Objects (finally! 😉) provided by Salesforce are called Standard Objects. The ones you create on your own are called Custom Objects. If you would like to dive into further details about Standard and Custom Objects in Salesforce, my next post is for you.

Now, without wasting any more time, let's jump straight to the Objects that form the basics of a CRM:

Lead
Imagine that your Organization had put up a booth at the recent Electronic Expo held in the city, and many stores had shown interest in your electronic items.
You have the details of the contact persons and of the stores, who were interested in your products. These Stores can become your customers, so you would wanna contact them. These potential customers are called as Leads in CRM terminology.

Lead is one of the standard objects that you get, when you sign up for Salesforce. Jump to your Salesforce org and enter the information you have in Lead object.

With the Leads' information stored safely in Salesforce. It gives your Sales Reps the power they've always wanted. The power to fetch whatever information they want to and where ever they want. The beauty of being on Cloud. 😊

But as everyone knows, "With great power, comes great responsibilities". So, your sales reps now have the responsibility of converting these "potential" customers to customers. 

Once a potential customer (Lead) seriously pursues a deal with you and is going to become your Customer. They don't belong in the Lead object anymore. So, in Salesforce you have the ability to convert the Lead into an actual customer. This is our next object.

Account & Contact
Account object holds the information of your customers (the electronic stores) which are going to purchase or have purchased your goods.
But a store itself didn't strike a deal with you, there was a person from the store who was dealing with you. That person's information goes into the Contact object.
Most of the times, there can be more than one point of contact for one store (or Account). Or, you can say an Account can have multiple Contacts. Or, Account and Contact have a one-to-many relationship.

Opportunity
Opportunity literally means, a chance of something. You have converted a Lead to an Account and a Contact, that means now you have a strong chance that this store is going to buy something from you.
Think of Opportunity as the deal that you have the possibility to close. The Opportunity goes through different stages as the deal progresses and is finally closed. Closing a deal means that the contract has been made and the product sold. Yoo-hoo.! Calls for a party, right?
There can be a scenario that the deal couldn't be completed. The Opportunity is closed in this case too, but is marked Closed Lost instead of Closed Won.

When you convert a Lead, Salesforce automatically creates an Account & a Contact; and also gives you an option if you would like to create an Opportunity.


The objects we just discussed are all standard objects in Salesforce. My next article is aimed at few more Standard objects & the Custom objects in Salesforce. Keep watching this space for more.



You can also Sign-Up for a free Developer Edition Salesforce from here.  The Developer Edition is a basic CRM, which you can register for, for free. It's always good to see the things in action. Helps you absorb what you have learnt. So, go ahead and try creating a Lead record and converting it into Account/Contact & Opportunity (optionally) in the Developer Edition org.

Sunday, November 26, 2017

A brief introduction to Salesforce !

If you are working in IT industry or rather any industry, you must have heard of the name Salesforce.
But what exactly is Salesforce? Is it a Software to use? A platform to code? Or what?

Let's demystify this, if you don't already know.

As Salesforce describes itself, it is the innovative company behind the world's #1 CRM.

If you are into Sales or Marketing, you can very well answer, what on Earth is a CRM.
For novice, CRM is Customer Relationship Management, using which you can easily manage your customers, potential customers, your partners, etc.
I know you must be like, Ahh! that's very explanatory. 😉 But don't worry I'll cover Salesforce as a CRM, in my next article. This definition should suffice for now.

Coming back to Salesforce !!
If Salesforce is just a CRM, what's so cool about it? What the fuss is all about?

It's not that Salesforce invented The CRM. CRM solutions dates back to the early 1970's, when these were just stand alone Mainframe systems. Then, came the revolution in the technology which made it possible to connect every system to every other system. Every Organization started moving its resources to Cloud, instead of relying on the home grown network.

Mr. Marc Benioff dreamt of moving the CRM solution onto the Cloud, and BOOM ! Salesforce was born.

Salesforce moved the CRM entirely on Cloud and provided it to the Organizations as per their need. Benefits of being on Cloud are manifold:

  • You no longer need to worry about the hardware and the software.
  • You can leave the worry of scalability to Salesforce.
  • You pay as much you use. Salesforce charges you on per licence basis.
  • If any new technology is emerging out, Salesforce will upgrade itself to provide you the benefits of it.  


Lastly, Is Salesforce just a cloud base CRM?

The answer is a big NO !
It is much more than that just a CRM. Salesforce provides you a complete cloud based platform to develop web-applications. Force.com is the name given to the Platform.

You can use Force.com either to extend the Salesforce CRM or to develop an entirely new application.

In addition to that Salesforce also has its own marketplace (Appexchange) similar to Google's Play Store and Apple's App Store, where you can find useful apps built on Force.com platform. Really cool, isn't it?


In the next blog, I'll cover the basic components of a CRM. Stay tuned !! ☺

Learn Javascript Remoting in Salesforce - with Example


What is Javascript Remoting?

Javascript Remoting is a way to call Apex Controller methods from Javascript (written on Visualforce page..). Unlike ActionFunction, Javascript Remoting allows us to call controller methods, without having to transfer the complete viewstate of the page.
As it does not transfer the ViewState, it can also save your Visualforce page from reaching the ViewState limit.

Sample Code
Let’s jump straight to the sample code which itself should be self explanatory.
Controller Class:
public class TestJSRemoting {
          @RemoteAction
          public static Account searchAccounts(String name){
          account = [SELECT Id, Name, Phone  FROM Account WHERE Name = :accountName limit 1];
        return account;
}
}

VF page:
<apex:page controller=”TestJSRemoting”>
          <script>
                  
          </script>
          <apex:pageBlock>
                   <input type=”text” value=””>
                   <button type=”button”>Search</button>
          </apex:pageBlock>
</apex:page>

Friday, May 23, 2014

Identify the row/record clicked in a Table on Visualforce page

Requirement

We need to create Visualforce page to display the data in our Salesforce instance. However, the data is not stored in any of the Salesforce object. The data is fetched using making a REST call to an external system. The response we are getting is in JSON format, so to display the data we are supposed to parse the JSON response and then display it on Visualforce page.

In this article, I am covering only one problem I faced while implementing this. The brief about the problem is I am able to display the data in the List view(as in standard Salesforce list view), using the PageBlockTable tag. Now, on the click of the record, I need to open a detail page of the corresponding record. Had the data been in Salesforce, I could have directly used the Salesforce ID to uniquely identify the record. But in this case, I dont have any unique identifier that can be used. So I need to capture the click of the User, that is the row index on which the user clicks to display the particular record. Or you can say, the index of the record acts as the unique identifier.

Solution

There can be two approaches to handle this situation:

  1. Use of javascript to identify the row number of the clicked element of the PageBlockTable.
  2. Use of <apex:param> tag to pass the index to controller.

I am going to discuss only the 2nd approach right now:

I will use a slightly different than normal approach to display the list of records.

In the controller class, we have a list of records, say in variable "allRecords". I will maintain another list of Integer as follows:

List<Integer> indexes = new List<Integer>();

This list of integer contains the numbers from 0 to n-1, where "n" is the size of the list of records, i.e. the size of "allRecords". Make sure to update the "indexes" list whenever "allRecords" is updated.

Now, in Visualforce page, use the "indexes" list to display the records.

Visualforce page code:

<apex:pageblockTable value="{!indexes}" var="ind">
<apex:column headerValue="Name" value="{!allRecords[ind].name}">
<apex:commandLink value="{!{!allRecords[ind].name}}" action="{!yourControllerAction}">
<apex:param name="index" value="{!ind}"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Street" value="{!allRecords[ind].streetAddress}"/>
<apex:column headerValue="City" value="{!allRecords[ind].city}"/>
<apex:column headerValue="State" value="{!allRecords[ind].stateProvince}"/>
<apex:column headerValue="Postal Code" value="{!allRecords[ind].postalCode}"/>
</apex:pageblockTable>

In the above code, the index of the link clicked by the user, is passed to the controller using the <apex:param> tag. In the controller, the record on the index can be pulled directly from the list like:

allRecords[index]

All done..!!