Community Update: Wiki Pruning, lots of Code Samples and IDE/Workbench/Google news
by Jon Mountjoy on July 15, 2008 at 07:46 AM
It's been far too long since the previous community update. To be fair, I have been doing a fair bit of traveling, mostly on the Tour de Force. Check out our videos from the Dublin event for a taste. In the interim we've released the awesome Google Data API Toolkit, and a new version of the Force.com IDE.
Besides the events, I've been doing a fair bit of blogging and learning about the platform. Right now I'm spending a lot of time pruning the wiki. I hope to make a few improvements, including making things a little easier to find. I've also started to use some of the wiki capabilities such as categories. So for example, here is a page of multimedia items on the wiki. It's not complete yet, but I hope you find it useful. Feel free to ping me about the wiki and any changes you would like to see (or not to see :-) ).
Enjoy the rest of this post, wherein I point to most of the new items that have appeared on developer.force.com recently.
Regards,
Jon
Resources
We have a couple of new resources for you:
- Force.com Toolkit for Google Data APIs - Code the Clouds and integrate Google applications with the Force.com platform
- Workbench 2.0 - a web-based, open source suite of tools to manage your org
- Force.com Developer Library - fact sheets, white papers, tutorials and two full-length books
- Force.com IDE Developer Preview Updated to Summer '08 - as I blogged, there's a new version of the IDE now available
Code
Check out the following new code samples:
- Testing Email Services with Inbound Attachments
- Creating Ideas from Inbound Emails using Email Services
- Visualforce Sample - Dynamic Edit Page
- Visualforce Sample - Consolidated Case History Timeline
- Visualforce Sample - Quote Generation with Pages2PDF
Many thanks to Andrew Waite and Rasmus Mencke for these great samples.
Blogs
Here are some blog posts that caught my eye:
- What the Cloud can Carry - Peter makes the case for enterprise developers to use SaaS and PaaS, not just SMSs
- Workbench: From Idea to 2.0 - Ryan explaining the history behind Workbench
- Intercepting Workflow Outbound Messages in a Ruby Server - I've been experimenting with Workflow and Ruby
- Emailing Visualforce Pages Rendered as PDFs - I've been experimenting with Visualforce and creating PDFs using the new
renderAstag
Multimedia
The following events/screencasts/webinars are now available for your viewing pleasure:
- Master Visualforce in Summer '08 - Move Beyond S-Controls
- The Force.com Platform & Google Data APIs in Action
Upcoming Events
From our event calendar, we have the following events that may interest you:
- Dreamforce '08 - Tour de Force at Dreamforce (November 2-5)
Technorati Tags: salesforce, tourdeforce, visualforce
Intercepting Workflow Outbound Messages in a Ruby Server
by Jon Mountjoy on July 8, 2008 at 06:31 AM
I'm learning about workflow and approvals, and I've just got a Ruby server intercepting SOAP messages that are sent via the Force.com workflow system when changes are made to an object.
The Basic Idea
The way I see it is that you can use the Force.com Workflow system to carry out actions under certain conditions on particular objects. So for example, if object Y has its field X set to Z then perform action Q.
The conditions I chose were on the Contact object, with an evaluation criteria of "Every time a record is created or edited." The action I chose was what this blog post is all about: an outbound message. Essentially you can have the Force.com server send out a SOAP message to your destination of choice with data.
This is very powerful functionality, and takes 3 minutes to set up. You can imagine using it for integration between Force.com and some other external system. You can also perform simpler actions, like updating fields, sending emails and so on. All of this happens automatically, and the actions are managed by the server.
Here's how I set this up to send a SOAP message to a Ruby server sitting on my own remote site.
Setting up the Workflow
Go to Setup/Workflow & Approvals/Workflow Rules/New Rule. Select the Contact object, give the rule a name such as "ServerPingChange", set up some evaluation criteria (I chose "Every time a record is created or edited") and a Rule Criteria (I set mine to "Formula evaluates to true" and have a formula of "true"). Hit "Save and Next" and "Done".
That's it. As you can see, you have a lot of control over the conditions under which the workflow rule will be selected. Now let's go ahead and create the action, which are reusable. That is, if we create an action for Rule Y we can also use it for a different rule too.
Setting up the Action
Hit "Edit" under "Workflow Actions" for the workflow rule you just created, then "Add" "Outbound Message". I gave it a name of "MyOutboundMsg" and for endpoint address you need to select your server name. For example, I used http://www.jonmountjoy.com:8080/ (Don't use my server please ;-) ). You can then select which fields you want to send along in the message. I simply chose Id and Lastname.
That's it! You'll now see a cool "Click for WSDL" which you'll want to do. Download that WSDL file - that defines what your SOAP server endpoint needs to look like. You'll want to activate your workflow rule now (hit "Activate" on the rule), and set up your security now in Security Controls/RemoteSites to ensure that your remote server has access to Force.com.
Now whenever you add/modify a contact, a SOAP message will be sent to your endpoint.
Monitor
You can check your progress so far. Go ahead and edit a contact for example. Now go to Setup/Monitoring/OutboundMessages. You'll see a log of outbound messages because, of course, at this point you have nothing listening on the other end.
Setting up your Ruby Server
I chose to use Ruby here. (I'll be trying this some day with Java and the Spring Framework if there's any interest.) Here's how I set up my Ruby server. It's somewhat convoluted as I had to set up a private gem home as my server is hosted and I don't have full control over it. Hopefully this will help folk doing the same.
Modify your .profile to accommodate a location for your gems if your server is hosted. I have mine include the following lines:
export GEM_HOME=~/ruby/gems/ export RUBYOPT=rubygems
Then I installed the soap4r gem, which provides the basis for my SOAP server. I did this by running
gem install soap4r
(Is there a better SOAP server out there for Ruby? This one looks pretty stale, although it works for my purposes. )
Now in a directory in which you have the WSDL downloaded from the previous step, execute:
~/ruby/gems/bin/wsdl2ruby.rb --wsdl wsdl --type server
You should now have a basic SOAP server! Let's tweak:
I modified NotificationService.rb like so, so that it listens on the correct port (the line is near the bottom of the file):
server = NotificationPortApp.new('app', nil, '0.0.0.0', 8080)
I added a line to DefaultMappingRegistry.rb so that it starts:
require 'default.rb' gem 'soap4r' require 'soap/mapping'
Unfortunately it took me an exceedingly long time to figure out that piece of magic. Why I need, I have no idea...
Now you can start hacking the piece that really matters, defaultServant.rb, which is the Ruby code that runs when a message is received. The soap4r gem makes it pretty simple to interact with the SOAP. Here's my final code that simply prints the incoming id and lastname:
def notifications(request)
p "Jack was here"
p [request.notification[0].sObject.id]
p [request.notification[0].sObject.lastName]
ackResponse = NotificationsResponse.new
ackResponse.ack = true
return ackResponse
end
The only tricky bit is ensuring that you create and return an ackResponse object. Without this, you'll receive the message but Force.com will keep resending it because it hasn't received a successful acknowledgement response.
Finally, run your server:
ruby NotificationService.rb
That's it! Here's the output I get whenever I modify the contact Tim Barr:
mountjoyj@sobek:~/oof$ ruby NotificationService.rb "Jon's Workflow Outbound Message Server Received:" ["0035000000N1GwjAAF"] ["Barr"]
Summary
I found outbound messaging pretty straightforward and easy to use. It took 3 minutes to set up the workflow rule, criteria and SOAP message, and I had great fun pulling my hair out getting the Ruby server to run :-)
Have fun!
History
I started learning this stuff as I was going to give part of the Workflow talk at Tour de Force in Dublin. Rick Greenwald ended up giving the entire presentation, thankfully. I don't know enough yet, and Rick knows it all. Thanks Rick!
Community Update: Intros, Tour de Force, Visualforce
by Jon Mountjoy on May 30, 2008 at 05:03 AM
I'm a new member of the force.com team, and I'll be working here as the community manager and editor-in-chief of developer.force.com. As a result, I hope to be touching base with a lot of you developers, ISVs and admins out there, as well our internal salesforce.com employees. I'll also be working at developing our blog and content strategies, infrastructure and more. There's a lot to do, and I'm keen to help our thriving community grow even bigger. Feel free to ping me at any time about the community, with any suggestions, complaints or comments (jmountjoy at salesforce dot com) or join me on Twitter or other data streams.
I will be producing a community update like this every week or two, highlighting forthcoming events (check out the awesome Tour de Force website with new events in the USA, Ireland and Japan), community members (see Anshu), webinars (Move Beyond S-Controls), interesting board threads, things that catch my eye (like the Dreamforce Session Idea site), external sites (Simon, Joe, Steve and many more) and so on, so please stay tuned.
Regards,
Jon
Resources
We have a couple of new resources for you:
- A short Visualforce Components Demonstration by Adam Gross shows off some of the capabilities found in Visualforce Components. This is going to big: reusable, modular, user interface components. I need to create a directory listing components that we can start finding them all. Done!
- A new Visualforce resource page recently went live, pointing to reference material, tutorials and webinars to get you up to speed on the technology.
Blogs
In the blogs, I'd like to welcome new blogger Anshu Sharma. Anshu blogged about being In India, with Force(.com)!, and some of the questions he encountered during a talk he gave on PaaS and Force.com.
Also in the blogs, Ron Hess tells us about Coding The Cloud at Google's I/O Event, where he's presenting on integrating force.com apps with Google GData interfaces. I'm also keen to see how our developers use the new Google Earth API. We've seen plenty of Google Maps mashups - now how can we use Google Earth too?
Finally, Peter Coffee has some interesting thoughts on what it means to be Disconnected. He makes the point that "..it's not the problem of any single technology provider (or even any particular subset of the tech provider ecosystem) to solve the problem of staying up and running even if your public network link is intermittent."
Upcoming Events
From our event calendar, we have the following events that may interest you:
- Tour de Force - in USA, Ireland and Japan (June/July)
- Webinar: Mastering Visualforce, Move Beyond S-Controls - (June 18)
- eBay Developer Conference - where we're keynoting and presenting (June 16)
- DreamForce '08 - suggest a session for the conference too! (November 2-5)
Education Services
Education services have two upcoming courses:
- FDC-320 Force.com: Application Laboratory - in various cities in the US (June/July)
- FDC-320 Force.com: Application Laboratory - in London, UK (June)
Technorati Tags: salesforce, tourdeforce, visualforce
Using Adobe Flex to Build Rich On-Demand App - Follow Up
by Dave Carroll on June 27, 2007 at 12:56 PM
Thanks to all of you who attended the webinar today. We really enjoyed presenting the exciting combination of Adobe Flex/AIR and the salesforce.com platform. I have created a wiki page to contain the code that I demonstrated today.
The sample is simplistic but illustrates some key concepts when using Flex and the Flex Toolkit for Apex. First is the data binding piece. Flex natively supports collections as the data source for data binding. The Flex Toolkit for Apex returns a collection as the result of a query. This makes simple binding extremely easy.
Another concept that is key, but was not illustrated in the webinar, is the ability to create your own components based on (inheriting from) the standard SDK components. This makes modifying the behavior of items like the Grid component very easy. This is especially true when compared to other "traditional" RIA technologies.
Grab the trial version of Flex Builder, or better yet, take advantage of the discount code presented in the webinar, and try some of this stuff out yourself. I am confident that you will not only find it useful but fun as well.
ActiveSalesforce 1.1.3 is here!
by Nick Tran on March 28, 2007 at 10:38 AM
Ruby-on-Rails fans, your 9.0 API friendly adapter is here.
Here's what's new:
* works with the latest rails and the latest rubygem
* uses select count() for performance increase
* supports LIMIT
* supports clientId
* API Relationships coming in 1.5
Note: In your environment.rb, change
require_gem 'activesalesforce'
to
require 'activesalesforce'
Check out this wiki page on how to get started with ActiveSalesforce.
UPDATE: 1.1.4 was just released to fix SID authentication connection management bugs.
Announcing PHP Toolkit 1.1 Beta
by Nick Tran on March 26, 2007 at 11:26 AM
The new PHP Toolkit 1.1 Beta is out! The toolkit now supports the 9.0 API as well as the Enterprise WSDL for the first time. Some of the new features include: merge, undelete, queryAll, and API Relationships. A special thank you to hemm, Claiborne, and Bill Eidson for the early testing and feedback.
Go get it here: https://wiki.apexdevnet.com/index.php/Members:PHP_Toolkit_1.1
Yet Another Update to the Flex Mashup Tech Note
by Ron Hess on January 31, 2007 at 02:52 PM
You may have read the recently published Tech Note on the Apex Wiki, where I explain how to create a simple Flex-based S-Control that can be added to a salesforce.com detail page. This describes an Adobe Flex component that provides a view of your opportunity data in a unique and compelling way. I've had several folks comment that this component is "wonderful eye-candy", but I really wrote it for developers, to show how easy it was to mash up Flex and AJAX in an S-Control.
Even if you are not interested in unique aspects of the user interface, there is still much to be learned by reviewing the code and the Tech Note. I got quite a few requests to package the sample code up so that folks could see this working with their data. So, I spent some time building and testing this yesterday and you can now install it as a package for the AppExchange. This is currently a private package, so you will see a red banner when you go to install it.
This is still a work in progress, as you will see if you look into the code. I hope to dig into this sample again soon to add Flash player version detection, and support for local currency symbols. I'd love to hear about it if you decide to take this code and map it into something grander. Since the Tech Note is part of the Apex Wiki, you can log in and click "edit" and add your contributions!
I plan to extend the TechNote with details on making a good package, so check back soon.
Share and enjoy.
AJAX Toolkit - Konfabulator Widget
by Dave Carroll on August 14, 2005 at 08:47 AM
Have you ever used Konfabulator (K)? It's an iteresting product that allows you to run widgets (basically a bundle of xml and javascript that describe little "applets") on your desktop. These widgets represent standalone (although widgets can communicate with each other), very simple applications that can interact with your computer and also with the network. I was interested in where the data was coming from in the stock ticker widget that comes with the installation of K.
What I found is that K exposes an object that is very similar to an XMLHttpRequest and the MSXML peer objects called URL. The methods and properties vary (not sure why the makers of K wouldn't try to match the current interfaces to ease cross-host scripting) in name, but are very similar in function. So, I thought, got a fairly decent start on a cross-browser toolkit, how about cross host? I set out to modify the toolkit then so that it could be used without modifications in Firefox, IE and now K.
To do this I basically just wrapped K's URL object and, using a dom js that comes in one of the shipped widgets, added some function names and prototypes so that the dom js could look and act like mozilla's dom and ie's dom.
I haven't gone back and tested this in IE and FF yet, but I got a decent K widget going that might be fun to mess around with. What is nice is that you really only have to figure out how to make a widget, any widget. The sforce API just works.
The widget attached is a modification to Arlo Rose's mini what to do widget. Basically it logs into salesforce.com when the widget loads, if the preferences contain your username and password. If not, a message is shown and you should right click the little feller and set the preferences.
Once logged in, the widget will go get a set of open tasks from your salesforce.com instance for the logged in user. There are several views of the task list that are available from a context menu. When you click the widget you have three options that appear. For each task shown, there is a magnifying glass icon and an x icon. The magnifying glass will pop a new browser window to the details of the task you clicked without asking you to login. The x will cause the task to be marked as completed (you will be prompted).
The last option is a little + button on the bottom right to create a new task. Depending on the choice that you made in the options for Add Mode, either a new browser will open directly to the New Task screen, or a simple K dialog form will be displayed to collect the data then create the task.
The widget uses a polling mechanism to keep the list up to date. The polling interval should not be set to execute more frequently that once every couple of minutes. (If that is too long, right click the widget and click Refresh).
Some ideas that might be fun and actually useful for K widgets for salesforce.com might be:
- dashboard widget (imaging "unhooking" your favorite dashboard item on your salesforce.com Home page and hosting it on the desktop!)
- Document managment (simple bi-directional drag and drop to open and save documents to the documents tab).
- Big Deal alerts.
- SControl uploader
Because K requires a relative path to any resources used, including javascript files, all the js files for the toolkit are included in the widget. This means that the toolkit included in this widget is not the toolkit endorsed by salesforce.com, but I'm fairly certains some of these changes will make it into the official toolkit. This will likely be determined by how many people want the toolkit to support K, so please let me know if you think K support is important or not.
Cheers.
SDForum
by Simon Fell on May 23, 2005 at 08:45 PM
Sforce PM Benji Jasik will speaking at SDForum tomorrow on Web Services, looks like an interesting lineup including Jeremy Zawodny from Yahoo, Tim Bray from Sun and Jeff Barr from Amazon.
Intro to Sforce Presentation
by Andrew Waite on April 13, 2005 at 10:49 PM
Slides of the Introduction to Sforce (API) given on 4/12 at the IntegrationforceDay event. Thank you to all who attended and the original Author, our sforce Instructor Sarah Whitlock!
Sforce Open Source
by Dave Carroll on April 12, 2005 at 05:59 PM
I just finished the Best of Sforce Open Source session at the Integrationforce Day at the Four Seasons Hotel in San Francisco. Several attendees requested the preso for this session so I am posting it here.
If you attended this session, please feel free to comment on what was good or bad about it or whether it was worth the price of admission (free).
Cheers
