Monday, 28 February 2011

Building Customer Portals Via Force.com

I recently started playing around with force.com sites a lot more than usual as a means to build a customer portal for a new business I am starting with a few friends. I thought this could be a good avenue since I could create a customer portal that easily integrated with our CRM instance. And since I understand the language and given the ease of Visualforce technology the turnaround time would be rather quick.

Here is the layout of the force.com template:

(showHeader should be turned off so you won't see any Salesforce standard tabs or sidebar)
<apex:page showHeader="false" id="SiteTemplate" standardStylesheets="true">
(A section is reserved for header of the site)
<apex:insert name="header">
<c:SiteHeader />
<hr/>
</apex:insert>
(This section is where you can include the content of each page of your site)
<apex:insert name="body"/>
(A section is reserved for footer of the site)
<apex:insert name="footer">
<hr/>
<c:SiteFooter />
</apex:insert>
</apex:page>

The developers that I spoke to in my network recommended that follow the same pattern when developing my portal.

Things that should be included in the 'SiteHeader' component is the logo, log in and out links, headlines, and site navigation menu (This is done with code snippets...either extracted or some cases newly written). The same way, you can modify the 'SiteFooter' component to add your site's pages footer template. It is also recommend to include your site's shortcuts links and your company copy right message in this section.

Adding the shortcuts links  in the 'SiteFooter' section is very important...particularly if you want to utilize organic search. If you are using dynamic menus this will easily compensate for that.

Next post will demonstrate how to add new pages to the force.com site.

Monday, 14 February 2011

Logging into the Salesforce Sandbox

As I continue to learn Ruby I thought it would be prudent for me to start working on a RoR app. That being since yet to be classified as an expert in this type of development...it is definitely best to work on this app in the Salesforce sandbox. The sandbox allows you to create copies of your environments for development, testing and training, without compromising the data and apps in your production environment. In this post we will go over the multitude of problems people face in order to access the sandbox to test and develop the application.

To start you need to be aware that you won't be able to login from https://login.salesforce.com that's only for production. The correct move is to use the sandbox instance https://test.salesforce.com (or https://cs1.salesforce.com, https://cs2.salesforce.com, etc.). It should be clear that email@domain.com is your regular username, but the "sandbox" part is the actual name of your sandbox. So if you named your sandbox as "sandbox" you would login as joey@example.com.sandbox. If your user account was established after the sandbox was created then it won't be present. A simple sandbox refresh will add your account into the sandbox. This is a pretty common error.

If for some reason that does not work you may be trying to access the incorrect sandbox. Go to the production organization where you can login. Navigate to 'Setup', then 'Data Management', then 'Sandbox' and then click the 'Login' button next to the sandbox you wish you login to.

Another common problem users face is the situation when you are able to use your production password to log into the sandbox...but cannot use it to hook up to the API. As a standard Salesforce trusts users that come through the web UI. However in order to log in to the API, you will need to append an extra bit of user information to your password aka your Security Token.

You can reset this by going to 'Setup', then 'My Personal Information', then finally 'Reset MY Security Token'.

The token will get emailed to you - it will be some obscure alpha-numeric token. Copy this and paste it to the end of your password. For example if your password was 'awesome', and the token was XYZ987xyz, the credentials to pass through would be:


Password: awesomeXYZ987xyz

Now go ahead and make as many mistakes as you like...I do it all the time.