Tag Archives: salesforce

Salesforce.com opens up Google Data API

Salesforce + Google

After getting a taste of its power, lets set it up and try it ourselves.

 

Leave a comment Continue Reading →

Hacking Salesforce – Part 2 (Release Management)

Salesforce Release Management

Salesforce always advocates us to make all the changes through its UI. It is nice but hardly a solution for a corporation. In a corporation, we used to develop everything in dev, launch to QA and test it, then launch to production. Salesforce claims its approach can shorten the release cycle. However, I don’t think we want to do thing in this way. For example, if we have hundred of fields to add and the application cannot be used until all of them are in place, what will you do to minimize the impact of users currently using your app? How can we rollback all the changes? How to test the changes before releasing them? Yes, you may get around this via switching layout or making new objects and fields available only for admin user. However, what if we don’t even want our developers accessing production box because the data there is sensitive.

All in all, we want a solution that we are able to develop on our sandbox, test it and push a button to release all the changes to production. To my dismay, I don’t see Salesforce provides us end to end solution in this aspect. To work around, I tell my team to do all the changes in the sandbox (Salesforce provides one if you are in enterprise edition but it only has metadata in it) and manually move the changes to production after test. It is a tedious process and error-prone. Finally, I decide to search around and luckily I found a way to achieve my goal.

Use Force IDE

Force IDE is released that works on the new Metadata API released on Summer 08. It is an awesome tool. Through this, I am able to back up my production metadata in xml format and put them in version control system (ie SVN). With the help of SVN, I am able to tell who has changed what, do a diff on different versions and rollback. It is a great tool for us. But when I look into this tool, I have faced some of the issues. Below are some of my findings:

  1. I cannot remove or rename existing fields.
  2. There is no standard objects.
  3. There is no approval processes
  4. If you custom objects have circular dependency, you cannot simply copy 2 .object files into the object folder and assume Force IDE will resolve it for you.
  5. I cannot move apex classes to production box.
  6. I lose the association between S-Control and button.

However, I am able to get around these via:

  1. Rename and delete fields using SF UI.
  2. Modify the package.xml to enable standard object synchronization. (detail)
  3. Use SF UI to add approval process
  4. Manually create the custom object via SF UI first. Then you can copy all the fields to it via Force IDE.
  5. Apex class cannot push to production unless you test it and deploy it via the migration tool.
  6. Manually associate the S-Control with button via SF UI.

However, although we cannot make release management simply pushing a button, we can live with that as Force IDE already does a lot for us.

Backup Strategy

Now we know how we deal with metadata and simplify the release management via Force IDE. How about backup the data? Salesforce provides us DataLoader tool that we can use to export Salesforce data in CSV file format. Apart from that, you can import the CSV file back to Salesforce. 

 

Leave a comment Continue Reading →

Hacking Salesforce – Part 1 (Resource)

Introduction of Salesforce

My company uses Salesforce as its online CRM solution. And I happen to be in charge of this team. So, I get a chance to mess around with it. The more I look into it, the more I like the idea and infrastructure behind it. I am not going to dig deep into the beauty of its architecture in this post. Instead, I would post some useful resources to get you to start playing with it. To begin with, I would open a developer account in force.com. The developer account gives you all the enterprise edition feature with no time limit. The caveats are that  you can only have 1 admin and 1user account, and your account is limited to several MB storage space only. However, it is good enough to get a good taste of Salesforce. After you sign up, you can go to its invaluable Wiki and Discussion Boards to obtain tips and starter tutorials. Salesforce also made 2 ebooks available. They are:

  1. Introduction to the Force.com Platform – for beginner
  2. Force.com Cookbook – for intermediate user

Now I assume you can do the followings:

  1. Create custom objects and fields via SF UI
  2. Build object relationships
  3. Create validation rule and approval process
  4. Customize the layout for object (very limited without Visualforce)
  5. Create S-Control
  6. Mess around with Salesforce Security Model.

Great! You are now empowered by Salesforce to build a solution for your company. However, you may encounter issues related to its UI limitation like you cannot hide a field when someone selects a particular field on a picklist (resolved by Visualforce) or you cannot populate another object when one object is saved (resolved by Apex Trigger). You may find a way to get around this problem but I bet it is not going to be pretty. If you are interested to unveil the true power of Salesforce, keep reading.

Become a expert user

If you are interested in solving the UI and functionality limitation above, please take a look at the following ebooks:

  1. Apex Developer’s Guide
  2. Visualforce Developer’s Guide

Become a developer

OK. You are like me, the tools above may not satisfy you completely. To fully control its UI, I would use Flex. To fully manipulate the data model, I would like to use its API. If you are interested in building the next killapp on top of Salesforce platform. Here are some of the APIs that you may be interested:

  1. Apex Web Services API – Covers the SOAP API in all its glory. I personally wish this was REST, but SOAP is better than everything but REST.
  2. Apex Metadata API – A newer API, the Metadata API allows us to define the structure (fields and relationships) of our custom objects via XML rather than via the declarative point-and-click interface. Unfortunately there’s no Metadata API available for standard objects (Contacts, Accounts, Opportunities) yet, but I expect that to change this year.
  3. Apex AJAX Toolkit API – The AJAX Toolkit is primarily used with S-Controls, which are being phased out in favor of Visualforce. To be honest, the AJAX Toolkit has always seemed like a workaround hack to me, and hopefully the combination of Visualforce and Apex Code will render it obsolete.

I will keep this post updated for the new features Salesfoce releases in the future. :mrgreen:

  

Leave a comment Continue Reading →

Power up Salesforce UI via Flex

Get started

Follow the steps below to get your first Flex salesforce app up in Salesforce.

  1. Register a developer edition account from Salesforce. Note: Dev account never expires but the account does come with a few limitations. You can only have two users, one an admin account so that you can build and install applications and the other a normal user account so you can test your work from the perspective of a normal user. The account has a 2MB data limit and you can send mass email. However, It is totally fine for playing around all the features that Salesforce provides.
  2. Download the Flex Salesforce Toolkit (ie. force.com-air_flex-1.0.zip). This toolkit provides the needed libraries to communicate directly with your salesforce.com database records from within a Flex application, using native ActionScript packages and returning strongly typed classes.The documentation on the classes can be found here.
  3. In this zip file, there is a library called as3Salesforce.swc in the bin directory just off the root of this zip file. It is the library you need to associate to your Flex project.
  4. Create a Flex project and include the swc library in it.
  5. You can follow this screencast to get your first project up.

What you can do after that?

Now you have your Flex application run locally in Salesforce. Here is my TODO list and the solutions of each one.

  1. Run your app under your own website and pull info from Salesforce using the same api.
  2. Run your app under Salesforce and have it pulled data from your system thru Flex Remoting (HTTPService, WebService, RemoteObject…etc).
  3. Can we use the API to pull Salesforce metadata like SControl?
  4. How can we provide our application via Apex Exchange?
  5. How can we use the Salesforce Flex AIR Toolkit to make have your application deal with Salesforce in offline mode? Look into this article.

What Flex gives you but not original Salesforce UI?

Now you know how to integrate Flex with Salesforce. But what problems that Flex helps us solving but not the original Salesforce UI?

  1. Capture user events on the fly and display additional fields or populate bunch of fields.
  2. Visual the data via Flex charting.
  3. Full control on the layout, and look and feel.

  

Leave a comment Continue Reading →