

or depending how you see it, using flex as a force.com application front end.
Either way salesforce is one of the PaaS (platform as a service) providers, that sees in Flex the technology for adding rich user interfaces to its applications. As we’ll have the chance to point out in numerous occasions, RIA’s and SaaS (software as a service) seem to be going hand in hand. Furthermore Air’s offline capabilities add a lot of value to the SaaS proposition for enterprise applications that need to be operational independently of connectivity.
So additionally to Saleforce’s own UI development tool (Visualforce), a Flex SDK is provided, that enables developers to build Flex applications that interface with Force.com backend i.e. the enterprise grade platform used by Salesforce CRM, one of the greatest SaaS success stories. The SDK is basically a library in the form of SWC (actually one for web applications and one for Air) offering an AS3 wrapper to Force.com’s Web Services (SOA) API.
So here’s a quick walk through the steps to build a first application:
Open a developer account at force.com
Once you do that you get a standard application data scheme and some sample data, coming from the CRM functionality. Go ahead and setup your application to define custom objects and relationships, using salesforce web pages. There are far more capabilities here (workflow, triggers, etc)
Download the Flex SDK, read through some sample apps and go ahead to build a Flex client that connects to your Force.com account. Watch out for some points that may get you stuck though, especially when building a web app:
Here’s a very simple Flex piece of code that connects to your force.com account, when deployed on your own web server:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” xmlns:salesforce=”http://www.salesforce.com/”
implements=”mx.rpc.IResponder” creationComplete=”init();” xmlns:objects=”com.salesforce.objects.*”>
<salesforce:Connection id=”force” protocol=”http”/>
<objects:LoginRequest id=”request”
username=”email address”
password=”password+security token”
callback=”{this}”/>
<mx:Script>
<![CDATA[
import mx.rpc.IResponder;
private function init():void {
force.login(request);
}
public function result(data:Object):void {
//now you can retrieve data by querying your backend
}
public function fault(info:Object):void {
//some error handling code }
]]>
</mx:Script>
</mx:Application>
So in all a rather straightforward procedure, although problems could arise from the lack of documented issues (2nd bullet above took me a couple of days to figure out). An effort worth making though, if an enterprise grade application targeting salesforce’s audience, is what you ‘re after.
More on force.com platform and flex as we further dig and share our findings.
If you would like to make a comment, please fill out the form below.
Recent Comments