Salesforce Summer ’13: Developer Features

There has been so much to cover in the release notes for Summer ’13, that I haven’t even touched on the features available for developers. There are some great things in this release for the developers as well! Here are some of my favorites.

RecentlyViewed Object

There is a new object called RecentlyViewed, that will be quite helpful. It allows you to query the recently viewed items list. It looks like the list stores the last 200 records per object that a user has viewed. You can’t query what another user has viewed, it only shows the current user’s recently viewed records.

In addition to this new object there are some new SOQL clauses: FOR VIEW and FOR REFERENCE. When you use either of these clauses in your SOQL queries, it will add the records returned to the RecentlyViewed object. While both clauses will update the RecentlyViewed object, they are meant to be used slightly differently. VIEW means the record has been viewed. REFERENCE means a related record has been viewed.

New Developer Console

The Developer Console has been updated with a new look and feel. That is all well and good, but the coolest new feature is Apex Code Completion. Completions are provided for Apex system objects and methods, user-defined objects and methods, and sObjects and fields. Just type Ctrl+Space to see your options.

TestVisible Annotation

This is a great new feature that will make testing your classes much easier. If you have private methods in a class, you can use the TestVisible annotation to make those private methods visible to test classes. This allows you to directly test the methods rather than rely on methods you do have access to. It makes finding bugs much simpler. There’s a good example in the release notes that shows how to use this new annotation.

DML Before Mock Callouts

Finally, this has been fixed! Mock callouts are great because they allow you to test your callouts rather than wrapping them with System.isRunningTest. The problem with these mockups before the summer release is that you can’t do any DML before the mock callout. That means you can’t setup any test data. Now you can insert test data before the callout is tested.

Test Methods Must Be in Test Classes

OK, this isn’t really something to be excited about, but it is important to note. To read up on why this change is important, read this great post on the topic.

Summer ’13: Chatter Actions

The Summer ’13 release of Salesforce offers a new feature called Publisher Actions. They take up a lot of pages in the release notes, but I want to try to explain why I’m excited about them with an example. Last month, Marc Benioff announced that Chatter would become the primary interface for Salesforce. Chatter Publisher Actions seem to be a step in that direction. They allow users to do a lot more right within the Chatter activity stream.

So what are these Actions? We saw a hint of them in the Spring ’13 release when Salesforce added the functionality to create tasks right from within Chatter. Fortunately this could be turned off because it was half baked. In most custom orgs, we have lots of record types and custom fields. When you created a task using the new task feature in Chatter, you were limited to standard fields and your default record type. That made it unusable. With the Summer release, Salesforce has dropped this functionality. If you want to use it, it you’ll have to recreate it by setting up an action.

To get started using Actions, you’ll need to enable them in Chatter. Go to Setup > Customize > Chatter > Settings and Enable Publisher Actions.

Create an Action To Create a Task on a Contact.

  1. Navigate to Customize > Contacts > Buttons, Links, and Actions.
  2. Click New Action and fill in the information.Creating an Action
  3. Edit the page layout to include the fields you want and save.
  4. Optionally, set predefined values for some of the fields. This is so much easier to do than URL hacking the new URL. Let’s predefine a subject:Predefined Values
  5. Edit your Contact page layout to include the custom Action. I’m also going to remove the Poll option, since I don’t want my users creating Polls on Contacts.:Edit Contact Page Layout
  6. Finally, navigate to a Contact and click the New Task button in the Chatter stream. You’ll notice our default subject and that it is automatically related to the Contact we are viewing.New Action
  7. Once the task is created, we will see that the task was created in the Chatter feed. This is the only time we will see this in the feed. If you create a task through the standard buttons, it won’t get logged to the feed.

Pretty cool stuff. I’d like to see the ability to have more than four actions visible in the Chatter feed. Once you get above 4, they start getting hidden behind a More drop down. Your users will need to know to look under there. Make sure you arrange the actions accordingly.

Something I haven’t touched on in this post is that there is also the ability to link an action up with a Visualforce page. That is something I plan on experimenting with in the near future and hope to report back on my findings.

Where do I think this is all going? The UI of the new actions feels a lot like Touch and I think that this will be how they deliver custom button functionality to that application. It is also moving more of the UI into Chatter and I expect to see a lot more things like this in the next few releases.

Summer ’13 Second Look

The release notes are out for Summer ’13 and they are amazing. There are so many changes that  it is going to take me a few blog posts to make it through all the ones I want to talk about. Go read them yourself, but don’t download them and think you’ve got them. These are a living document until the release happens, so always download the latest version each time you want to look at them.

This release really feels like they’ve addressed many items core to CRM. There are still a lot of bells and whistles too that will be cool, but I’m most excited about core enhancements. This blog post will focus on those.

Customizable Price Books Price Books are becoming a first class object! You can add custom fields, modify page layouts, define Apex triggers, and more.

Record Types in Permission Sets Permissions Sets have been awesome additions to Salesforce and this new improvement really makes them even more functional. There’s a lot of details in the release notes about how this works.

Owner Fields in Custom FormulasYes, I mentioned this one in my last post. Can you tell how happy I am to have this feature? In the past you had to use triggers to get at Owner fields. We are now in button-click land! There are so many uses for this, I’m sure it could be its own blog post.

Checkbox Formulas Sometimes little improvements like this one make me so happy. I’ve always hated creating formula fields that you want to be a simple checkbox and instead have to have the output be test like YES or NO. Now there is a new formula type that results in a checkbox.

checkbox formulas

Custom Settings Copied to All Sandboxes I’m not sure how I feel about this. I think I like that custom settings will be copied to all sandbox types now including developer ones. In the past, custom settings were like data and not copied over. This could be a “gotcha” if you are storing endpoints for callouts in your custom settings and they point to production.

DML Before Mock Callouts Best practice when testing is to insert your test own test data rather than relying on data already existing in the org. The problem until now has been that you would receive an error when testing callouts. They’ve fixed this!

TestVisible Annotation This little improvement is going to help greatly with writing unit tests. Before this release, classes with private methods were kind of a black box and you couldn’t get down to the individual components to test them. Well, now with the TestVisible annotation, you can mark private methods, inner classes and more as visible to tests, so you can write your tests more easily.

Approval Processes in Change Sets and Metadata API Ever spent a painstaking amount of time creating an amazing approval process in your sandbox and then realized you can’t deploy it to production? Now that the Metadata API supports approval processes, you can actually deploy them to production.

Summer ’13 First Impressions

The Summer ’13 release of Salesforce is coming soon and you can signup for a pre release org to get a preview of the features that are coming. Sign up for a pre release org and follow along as I go through some of the cool new features. There are no release notes yet, so it is like an Easter egg hunt right now. Who knows what hidden features we will find!

One of the first things you’ll notice is that the Setup link has surfaced back on the main page next to your name. Click on that setup link and boy are there some changes! More common tasks such as user management have been moved to the top and other sections have been renamed. It will take some getting used to, but I think this is a good step in the right direction.

New Setup Links

New Setup Menu

 

One of the first new features I found is Chatter Publisher Actions. This allows you to define additional actions that can be done in the Chatter feed. You can customize these for each object and also add some for use on the main Chatter tab. It looks like you can create records or link to a Visualforce page that will allow the user to do something. The following screen shot shows a custom action to create an Account.

Chatter Custom Actions

 

My favorite feature so far with this release is the ability to reference Owner fields in formulas and workflow fields. This opens up a world of possibilities that were only possible with triggers in the past. Just a few use cases: run workflow rules based on fields on the Owner’s user record. Do field updates and use the owner information.

Owner Fields in Formulas

 

That’s all for now. I’ll keep playing with it and post my favorites. What are features you like in the coming release?