Summer 11 Pre-release and the System.URL class

The Summer 11 pre-release program is now available. Have you signed up for it, and the pre-release webinar on May 10th? If you have, you may have noticed a very helpful new Apex class, System.URL.

One of the trends I have noticed in the past few releases is an even greater emphasis on openness on the Force.com platform. Spring 11 dramatically reduced governor limits and increased the size of some message payloads to make it easier to perform many connectivity use cases. Summer 11 is no different with just in time user provisioning, a new Chatter API (stay tuned for more on this front – I'm working on a cool sample app now), and more. 

If you haven't noticed, Summer 11 pre-release is now available. I always think it is a good idea to sign up early and read the release notes prior to the pre-release webinar scheduled for May 10th. There is only so much you can do in a 45 minute webinar. A little 'playing' beforehand always helps you get the most out of the discussions and samples presented. Besides, if you can jump straight into your Summer 11 org directly after the webinar, you can put some of your newly learned skills to the test.

Once you have signed up for your Summer 11 pre-release org, you can download the release notes and start getting familiar with the new features. I typically save the release notes on my desktop for the first month or so and refer to them often. In addition, I always follow my four step readiness program I shared when Spring 11 was announced. 

But sometimes it is good to start with the basics – the URL. 

We often forget that the trusty URL is key to so many things these days, without it where would REST be for example? Ah, URL, we have had some great times over the years. You never fail to PUT a smile on my face and GET me to smile (sorry for sad, HTTP humor there…..I couldn't resist).

Summer 11 introduces the System.URL class to allow you to create links to objects in your organization. This class is super helpful when you want to link to a document in content, maybe a link to something from within an external email, or within a Chatter post via a trigger for example. 

Here is a quick example taken from the release notes, (and enhanced to ensure correct operation if no data exists) which creates an external-friendly link to an account record:

List<Account> acct = [SELECT name FROM account WHERE name = 'Acme' LIMIT 1];
if(!acct.isEmpty()) {
String fullRecordURL = URL.getSalesforceBaseUrl().toExternalForm() + '/' + acct.get(0).id;
System.debug(fullRecordURL);
}

I know this is a super simple example but there are so many places where this would be amazingly helpful. I can already think of a dozen I can use on the road to Dreamforce as we prepare our sessions and work with the speakers etc. 

So here's to the URL, and Summer 11!

 

Leave your comments...

Summer 11 Pre-release and the System.URL class