
Introduction
Salesforce.com is a CRM (Customer Relationship Management) web site that has revolutionized how businesses interact with their clients and prospective clients. A business can manage, communicate, and sell to their clients using all the powerful online tools provided by Salesforce. Such tools include account and customer tracking, lead follow-up tools, collaboration applications, and customer support services. And if that's not enough, Salesforce.com has an API which allows developers to hook into their various CRM products. RSSBus provides a product that makes getting to the CRM data on Salesforce a breeze. As with their other RSSBus tools, such as their Google API Provider and Quickbooks Provider, the Salesforce provider allows you to access the API as an ADO.NET data provider. Because RSSBus is a data provider, this product makes it much easier for developers like you and me to utilize .NET standard practices to access the customer and prospect data in the underlying Salesforce web service. By using a strong presentation library like Syncfusion coupled with the RSSBus Salesforce Data Provider, we can create some useful and visually appealing applications very quickly to take advantage of the CRM data with Salesforce.com.
RSSBus For Salesforce
The RSSBus data provider has six different data table representations for accessing Salesforce data: Accounts, Campaigns, Events, Leads, Opportunities, and Products. There are also database views for Contracts, Cases, and Contacts. In addition to being able to query tables and views of the Salesforce data using the RSSBus provider, you can also call some useful stored procedures. You can use the provider's stored procs to perform CRUD operations to either add, delete, or update an entry in any of the 6 Saleforce data tables provided. RSSBus also has a caching feature which you can activate to speed up querying of the Salesforce data tables.
Getting Started
The only obstacle to using Salesforce application is the difficulty of signing up for the for an API license on Salesforce.com. This took a couple of hours and required using the RSSBus web demo application to test my license login information to ensure that it worked. One of the challenges I ran into was that the system required a security token in addition to the user name and password. Once I figured how to get the token and how to add it to my password (simply by concatenating it), I was home free. Below is a sample connection string that I needed to put in the web.config file of my ASP.NET app, to get things going:
<connectionStrings>
<add name="SalesForceConnectionString" connectionString="[email protected];Password=salesforcebJOm3JgJQ4XKWLGDjL4YfdO1" providerName="System.Data.RSSBus.SalesForce"/>
</connectionStrings>
Displaying Account Data in MVC
I chose ASP.NET MVC technology in order to show the ease of use of RSSBus and how we can leverage Syncfusion to make interactive presentation of our data on the web. The Syncfusion ASP.NET MVC components are well designed and demand little coding from a programmer's standpoint. The grid is a fluent control and requires only a single line of embedded code in the page to produce results from the server. The data for customer accounts on SalesForce.com can be extracted in a few lines of code by leveraging the RSSBus Provider and using its Salesforce DataReader capability.
Creating the Project
Creating a Syncfusion ASP.NET MVC project was fairly straightforward because Syncfusion provides a template for creating projects for the Syncfusion Grid. The project didn't seem to have any sample grid in it, which I would have expected, but perhaps I overlooked it. Fortunately, I was able to find plenty of samples online at the Syncfusion Website. Figure 2 shows the template provided after you install the Syncfusion Essential Grid.

Figure 2 - Syncfusion Project Template for Creating an ASP.NET MVC Project with a Grid
The Code
The code for displaying a Syncfusion grid in an ASP.NET MVC page reminds me a lot of the code used by the MVCContrib grid, but the Syncfusion grid has a lot more functionality. Listing 1 shows the html helper in the Syncfusion library used to produce our Salesforce grid of Account Data. Notice that the embedded grid is a single line of code to produce the entire table (with the help of lambda expressions). The Syncfusion grid also allows us to easily format and sort our columns. Although it is not illustrated here, it is pretty easy to implement paging as well.
Listing 1 - Page using Syncfusion Grid to Display Salesforce Data
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcGridForSalesForce.Models.Customer>>" %> <%@ Import Namespace="MvcGridForSalesForce.Models" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Home Page </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2><%: ViewData["Message"] %></h2> <p> <%=Html.Syncfusion().Grid<Customer>("Product_grid") .Datasource(Model) .Caption("Customers") .Column( column => { column.Add(p => p.Name).HeaderText("Full Name"); column.Add(p => p.Phone).HeaderText("Phone").Format("{0:1 - (###) ###-####}"); column.Add(p => p.AccountNumber).HeaderText("Account Number"); column.Add(p => p.AnnualRevenue).HeaderText("Annual Revenue").Format("{0:###,###,###,###,##0}"); }).EnableSorting() %> </p> </asp:Content> |



Raj KumarPosted Feb 20, 2011, 11:33 PM
Great article mike...let me install Syncfusion ASAP :)
Suthish NairPosted Feb 20, 2011, 11:18 AM
From where can i download above MVC templates. Trying to install MVC2 but new version MVC3 prompting up. Is this a beta version?