Saturday, 13 October 2012

London Salesforce Developers Meetup

The London Force.com Developers group is now on meetup.com and has a new name - London Salesforce Developers. The inaugural meeting of this new look group took place on 10th October 2012 at a new location - the London Offices of 10 Gen.  A further change is that Wes Nolte now has some Salesforce assistance to organise these events, in the shape of Developer Evangelist John Stevenson.  

The subject for the meetup was a "Teardown of what happened at DFX", attempting to bring some of the excitement of Dreamforce 2012 to those who were unfortunately unable to attend, via a panel guided discussion session.  Although I'd volunteered for the panel, I hadn't actually participated in one of these before so wasn't 100% sure what to expect.

This also featured a special guest from Salesforce.com - Adam Seligman, Vice President of Developer Relations for Salesforce.com and Heroku.  If you've seen the Developer Keynote from Dreamforce 2012, Adam was the speaker opening and closing it.  There was an additional, unexpected guest from Salesforce.com - Peter Coffee - which I'm pretty sure is the first time we've had someone with their own wikipedia page at one of these events. The fact that we are seeing some of the senior executives from the US attending these events shows how important these meetups are.

The evening was compered by Wes Nolte and the panel consisted of myself, Andy Mahood, John Stevenson and Adam Seligman - here we are in all our glory:

I now know that a session of this nature consists of the panel arranged in front of the audience, each responding to questions posed by the audience.  Imagine Question Time with and for geeks :)

The first question was put by Wes to get the ball rolling, and asked what inspired us most about DFX.  Predictably there was plenty of reference to the Dev Zone, as this had an incredible amount of attendance, excitement and energy around it.  The questions were then opened up to the audience where, after a slightly slow start the questions came thick and fast.

Another advantage to Salesforce involvement is increased levels of schwag, including the ever popular Force.com baseball caps and copies of Dan Appleman's Advanced Apex Programming book.  Some of the goodies were handed out for the best questions during the Q&A, while the rest were handed to the panel to award for the correct answers to trivia questions.  As many of my readers will know, I've been building an online testing system in Force.com  and had recently released a workflow test, so unsurprisingly my question was on workflow actions.  

That concluded the organised part of the evening, so we then made our way to The Fox to continue the networking and discussions late into the night.

For those that couldn't attend, there's a highlights reel available on youtube courtesy of @Sarah_tquila - make sure you get yourself along to the next one!

 

Saturday, 6 October 2012

Snippet View

Something I've had kicking around in my toolbox for a while now is a Snippet View page - this is a Visualforce page that provides headline information on objects that haven't been shared with the user.  This allows, for example, a user to see the name and type of an account and the user that is the owner even though the sharing rules don't give them access to the full account record.  In a private sharing model this can be a useful way to prevent duplicates - the user can see if an account already exists and request access to it without exposing sensitive information.

Back when I originally wrote this I had a set of fields that were retrieved and stored as text values in a custom class for use on the page.  One downside to this was that no specialised formatting associated with the field (if it was a rich text area, for example) applied, as they were simply text values.  With the introduction and subsequent improvements around Field Sets, I've rewritten my snippet view page and controller to deal with actual fields rather than text representations and decided it is a good candidate for a blog post.  

A further improvement is that the snippet page now handles any subject type, standard or custom, as long as there is a field set named 'Snippet' defined (or in fact a field set name 'KAB_TUTORIAL__Snippet', as my dev org has a namespace!).

The controller is pretty straightforward

public class SObjectSnippetController {
	/* The id of the object provided on the URL */
	public Id objId {get; set;}
	
	/* The sobject type, determined from the ID */
	public String sobjType {get; set;}
	
	/* The fields in the field set */
	public List<Schema.FieldSetMember> fsMems {get; set;}
	
	/* The sobject, with only the members of the field set populated */
	public Sobject sobj {get; set;}
	
	/* Error string - used if there is no Snippet field set defined */
	
	public String errorStr {get; set;}
	
	public SObjectSnippetController()
	{
		/* extract the id from the URL */
		objId=ApexPages.currentPage().getParameters().get('id');
		
		/* determine the sobject type and its defined field sets */
		Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
		Map<String, Schema.FieldSet> fsMap = null;
    	for (Schema.SObjectType sot : schemaMap.values())
    	{
     		Schema.DescribeSObjectResult descRes=sot.getDescribe();
     		String kp=descRes.getKeyPrefix();
     		if (kp==((String) objId).substring(0, 3))
     		{
     			sobjType=descRes.getName();
     			
     			/* store the field sets for later processing */
     			fsMap=descRes.fieldSets.getMap();
     			break;
     		}
    	}
    	
    	if (null!=fsMap)
    	{
    		/* locate the field set for the snippet fields */
    		Schema.FieldSet fs=fsMap.get('KAB_TUTORIAL__Snippet');
    		if (null!=fs)
    		{
    			/* use dynamic SOQL to retrieve the fields in the set */
    			fsMems=fs.getFields();
		        String query = 'SELECT ';
		        String fieldsStr='';
        		for(Schema.FieldSetMember f : fsMems)
        		{
            		fieldsStr += ', ' + f.getFieldPath();
        		}
        		
        		query += fieldsStr.substring(2) + ' FROM ' + sobjType + ' LIMIT 1';
        		sobj=Database.query(query);
    		}
    	}
    	
    	/* if we don't have an sobject, that implies the administrator hasn't defined a field set */
    	if (null==sobj)
    	{
    		errorStr='Your administrator has not defined a snippet view for this object type';
    	}
	}
}

The key feature of the controller is the declaration

public class SObjectSnippetController {

As this is implicitly 'without sharing', this allows the record to be retrieved without the sharing rules being applied to the currently logged in user.

The page simply iterates the list of fields or displays the error message:

<apex:page controller="SObjectSnippetController">
  <apex:pageBlock title="Snippet View" mode="maindetail">
    <apex:pageBlockSection >
      <apex:repeat value="{!fsMems}" var="fld" rendered="{!ISBLANK(errorStr)}">
        <apex:outputField value="{!sobj[fld.fieldPath]}" />
      </apex:repeat>
      <apex:outputText value="{!errorStr}" rendered="{!NOT(ISBLANK(errorStr))}" />
    </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>

 

If I attempt to access a record that isn't shared via the regular UI, I receive the expected insufficient privileges error:

 

If I then access the same record via the SnippetView visual force page, I can see the fields that the administrator has added to the snippet field set:

 

 

However, if I attempt to access an object that doesn't have the field set defined, I receive an error message detailing this:

 

Saturday, 29 September 2012

Thoughts on Dreamforce 2012

Dreamforce is Huge!

In fact it was huge in 2011, I really need a new word for 2012.  Over 90,000 registrants and I've heard numbers between 50 and 80,000 actually turned up.  As well as the Moscone Center (that's North, South and West), Dreamforce now includes 34 hotels.  It feels like there's a tipping point approaching - just how much bigger can it and stay in its current location.  We all know Marc Benioff loves San Francisco so I imagine it would be hard for him to move it to somewhere like Las Vegas.  Another idea I heard was to split it by functionality into multiple weeks - personally I think that would lose some of the sense of occasion - a drip feed of small conferences rather than one mega-event.  I'd also imagine that would put quite a lot more stress on the SFDC employees - having to organise and staff multiple events, trying to get prospects, customers and partners to attend each of these in equal measure - that sounds like it would bring as many problems as it would solve.  All I know so far is that the Moscone Center is booked for November 18th-22nd 2013, so it looks like its staying put for a while.

Salesforce Values Its MVPs

If you are an MVP you get treated rather well at Dreamforce - thanks mainly to the the amazing Erica Kuhl.  This year included a tour of One Market, a bowling event, a shoutout at the Community Keynote, Force.com MVP lunch (thanks Dana Le and Nick Tran), VIP seating for the keynotes and much more.  

Get To The Community Lounge

The Community Lounge is a great innovation. Its the place to find an MVP outside of their sessions and there were daily presentations on hot community topics.  Aside from that, the wifi was solid and there were comfortable seats and beanbags.  When I needed to work during the event, or relax and eat lunch, this was my preferred location.

Keynotes Are Popular And Run Long

If you want to hear the keynotes in person, you need to be up with the lark.  The rooms aren't big enough to hold everyone that wants to attend, so you need to get in line early, especially if you want a good view.  I always enjoy Dan Darcy's involvement in these - there's a real frisson of excitement when the screens switch over to him and his team.

Keynotes always overrun, but this year it was pretty much a full hour over.  Something to bear in mind when reserving your spots at sessions immediately after - I had nothing scheduled until 12 but still didn't make it.  Being in the VIP seats a few rows from the front does make up for it though.

Don't Stress About Your Agenda

There are so many sessions on at any one time, you are never going to be able to fit in all of those that you want to attend. Add to that keynotes running long, unexpected networking opportunities, meetings with or entertaining customers, distances between venues being larger than expected and simply being tired, and you'll find you can't even keep up with those that you added to your agenda. Don't sweat it, most sessions aside from roadmap are recorded and made available on the Dreamforce Youtube Channel so you can always catch up afterwards.  Once you realise that you are missing most of the sessions anyway, due to their being only one of you, its easier to relax about it.  Get to as many sessions as you can, but don't get so hung up that you miss out on the rest of the conference.

Dev Zone Is Awesome

Bigger and better than ever this year.  Unconference, mini-hacks, community common, developer theatre, touch stadium and more sessions than you could hope to get to.  The Workbooks and Salesforce Touch Platform books were very popular - by the second day these were being rationed and handed out from a counter rather than the free-for-all of the first day, which presumably depleted stocks to a worrying level. Throw in video games, code consults, t-shirt printing and a mini-expo and what more could you want.

Developer Keynote Is Unmissable

Okay so as a developer I'm biased, but this was the first year with a Developer Keynote, which included exciting announcements, entertaining demos (even, dare I say especially, those that didn't work) and a free copy of Advanced Apex Programming for everyone that attended (including those that were in line but couldn't get in). Next year this needs to be in the big room and last 3 hours like Marc Benioff's keynote!

You Don't Have to Stay in a Hotel

The hotels fill up quickly around Dreamforce time - the amount of people staying at the airport or over in Oakland was surprising.  If there are a group of you going, consider hiring a house or an apartment.  This is our our team from BrightGen did it this year and it works really well, you get the common areas of the kitchen and lounge plus your own space (as long as there are enough bedrooms!).

You May Be Going "Out Out"

When you leave your hotel/apartment/house in the morning, you may think you are just spending the day at the conference and will be returning prior to heading out to one of the parties in the evening.  Be prepared that this may not be the case - there are so many events, drinks, meetups and tweetups going on that you can easily find yourself out for the whole day and evening.  

You're Going To Need A Bigger Suitcase

Pretty much every everything on the baggage carousel at Heathrow was spherical or had a 'heavy' tag on it.  Make sure you leave plenty of room for schwag - even if you don't plan on getting any, you are bound to end up with some books and t-shirts at the very least. Failing that, buy an empty suitcase out there and fill it up for your return.

Nothing On Announcements?

You may be surprised that none of my thoughts on Dreamforce cover the Force.com/developer announcements - that's because the next London Meetup will be a panel guided discussion on these topics, so if you want to hear more about those then join us for that.  If you need another reason to attend, Adam Seligman, VP of Developer Platform Marketing for Salesforce.com, is the special guest. 

Tuesday, 18 September 2012

Guest Post - Dreamforce '12 Delivers Real-Life Socialized Service Model

In another first for the Bob Buzzard Blog, it's Guest Post time.  Ashley Furness is a CRM Market Analyst at Software Advice.  A couple of weeks ago I tweeted out a link to a story that Ashley wrote and we thought it would be cool for her to write a version specific to this blog and its audience.  Take it away Ashley ...

Dreamforce '12 Delivers Real-Life Socialized Service Model

Dreamforce - the cloud computing event that draws more than 50,000 to San Francisco every year - kicked off this week with more than 750 sessions for developers, media and other industry power players.

In addition to the planned events, organizers will again feature the "Salesforce Service Cloud Call Center,"  but this year it's all about social. This live customer service response hub will provide onlookers a chance to see expert social response in action. Why social for customer support? 

“I don’t think there’s any company out there that doesn’t need to be thinking about [customer service through social]. I guarantee your customers are already using the channel, and they’re probably already talking about your brand,” says Fergus Griffin, senior vice president of solutions marketing for Salesforce.com.

"Salesforce Service Cloud Call Center" observers should be able to glean some tips by watching, but here's a few best practices you should take home from the event.

Hashtag Common Queries

Griffin told me that last year during Dreamforce most interactions across all service channels involved questions about where things were located, recommendations for events, and tips for getting around the conference. Hashtags allow customer service managers to instantly create a knowledge base for topics such as these.

During this year’s event, Salesforce Service Cloud Call Center agents might hashtag common queries with things like #Dreamforcemaps, #Dreamforcefood or a more general tag like #Dreamforcehelp.

Then, if a Dreamforce visitor tweets, “Where’s the closest restaurant?” the agent could respond “@UserName check out everyone’s food recommendations by searching #Dreamforcefood!” When they search that hashtag, the visitor could scan through everyone’s suggestions. This saves the agent time, while still providing a helpful personal response.

Depending on what hashtags emerge, you're company may also choose to add these to the self-service knowledge base on the website. 

Post Publicly First

John Rote, Vice President of Customer Experience at Bonobos, compared support through social media like troubleshooting in a coffee shop or bar.

“It’s likely more people will hear about it and pull friends from across the room to listen. This can mean a bad experience is shared further, faster,” says Rote, who will sit on a social customer service panel at Dreamforce called “How Small Businesses Keep Up with the Velocity of Customer Service."

To mitigate this risk, Rote suggests companies always acknowledge the comment in social before taking the interaction to another channel. This approach publicly demonstrates that the company is listening and responds to everyone. If the interaction was taken straight to email, no one would know customer service addressed the problem.

This is also useful for companies that stream their Twitter feed in the infrastructure of the website. Again, it adds a personal face to the company and shows website visitors you're listening. 

Prioritize Thoughtfully

One of the biggest challenges with providing customer service through social is dealing with the sheer volume of requests. Griffin said companies should have a well-defined strategy for prioritizing responses.

This should include ranking factors from social–a Klout score, for example–and customer history. A company might choose to respond first to longtime customers or those with a history of high-value purchases.

“Companies should strike a balance between who [the customer] is in the community, but also who they are to you,” Griffin says.

Engage Customers You Might Never Have Known

Customer service through social media is not just about providing another interaction channel in addition to phone, email or live chat. Bonobos found out through customer surveys that social media support engaged customers who might never have sent their question otherwise.

“The thing that was really amazing to us was 3-4 months after [implementing our social customer service strategy], we found out that most of those customers identified never would have reached out to us if they weren’t able to do it over Facebook or Twitter,” Rote says.

So, take a minute to check out the Salesforce Service Cloud Call Center this year and learn other strategies for elevating your social customer service strategy. 

Research for this article was provided by Help Desk Software Advice.

Video: http://www.youtube.com/watch?v=rO5tdE9mtnE

 

 

Sunday, 9 September 2012

Online Quizzes Built on Force.com

If you're a Facebook friend of mine, over the last few weeks you'll have seen status updates regarding an online quiz app that I've been working on.  I started off calling it an online testing system, but decided against that as it had too many connotations of an app that allowed unit tests to be executed!

My original idea for the app was to use it to determine individual's readiness for Salesforce certification exams and crowdsource the questions as a free for all. However, I'm rethinking how the questions will be authored based on the various compromises of real questions that have taken place this year.  I'm still planning to allow the community access to author questions, but in a more controlled fashion and limiting the number of questions an individual can write on a single topic.

A screenshot of a question is shown below :


One of the key aspects for me is the ability for candidates to give a percentage rating to their confidence in the answer.  This is based on my approach to taking the real exams, as it allows me to determine how close I think I am to the pass mark.  I find it particularly useful when assessing a candidate's readiness, as if they are getting questions wrong when they were 100% confident in their answer, that implies there is a fundamental lack of understanding in that particular concept.  There's also a couple of free text areas for candidate notes and feedback on each question.

Each question is marked with a topic, which identifies which test it belongs to, and an area which is simply a free text sub-topic - Workflow is an area under the Force.com topic for example. The areas are used to provide feedback to candidates about areas they are weak on - at the moment its simply the first five unique areas encountered when marking.  I do plan to make this more sophisticated, taking into account the candidate's confidence and the number of incorrect answer in each area, for example

Something that applies both to tests and surveys (and many other question and answer scenarios) is the requirement to decouple the questions from those presented in a test instance. For example, if a questions is worded incorrectly and I fix it, I don't want to retrospectively update that question as posed to a particular candidate, as its not the question they answered. The trick here is to have the concept of questions as templates, and clone these when creating a test instance. Mine are called question responses, and that is where things like the feedback live.

Questions can be single answer (radio button), multi-answer (checkboxes), putting answers in order (picklists) or free text (long text area). The first three are automatically marked when the test is submitted, while free text requires a human to review the text.

As I want to be able to have (at least) users and contacts as test candidates, I couldn't use master-detail relationships and standard roll up summary fields. Instead I used this excellent utility from Anthony Victorio that allows roll up summary behaviour via regular lookup fields. It only takes a few minutes to set up and has worked fine for me thus far. The only trick is to remember to "touch" all the child objects when you add a new parent summary field.

The app is built on Force.com sites using composition templates.  The design is from Free CSS Templates - a great resource if, like me, design isn't your strong suit.

At the moment there's just a single test on Dreamforce X to allow me to test the site out in a controlled fashion.  So give it a go and let me know what you think.  If you would be interested in writing or marking questions, please tick the boxes on the test signup form.  On the results page there's a link to tweet out the score - don't feel any pressure to do this, but if you do want to that would be cool.


You can access the site at: http://tests.bobbuzzard.org

Wednesday, 5 September 2012

Book Review - Advanced Apex Programming

Disclaimer: Dan Appleman sent me a copy of the book to review.  I was going to buy it anyway and reading it has convinced me that would have been one of my better decisions.




In a first for the Bob Buzzard Blog, its book review time. If you are a Force.com developer you may well have seen a flurry of activity in early August around a new book by Dan Appleman entitled "Advanced Apex Programming". My curiosity was piqued by the news as it was immediately clear to me (and no doubt many others - the wonder of hindsight!) that there was a big gap in the market here. It received the Dave Carroll seal of approval shortly after, which is more than enough justification to purchase as far as I'm concerned.

The first line of the introduction promises that this book is not a rehash of the Salesforce Apex documentation and it was a relief to find that really was the case, even towards the end of the book which in my experience of development books is when authors can run out of steam and resort to regurgitation.

The style of the writing is quite conversational, which makes the text sections an easy read for a book that covers advanced development techniques and patterns. The example code is often a different matter - not because its badly written, but because it takes (or took me anyway!) a couple of iterations to understand exactly what it is doing. Its worth putting the effort in to understand the code though, as when you do get to grips with it there will be a few light bulb moments when you realise how useful this new technique you have learnt would have been in the past.

Probably the most interesting section for me was Application Architecture and Patterns - there are some great concepts for trigger handling and asynchronous processing. I also learnt a few things about Apex - at least one of which made me want to bang my head against a wall and cry out "why?". I'm pretty sure that knowing these facts will save any reader several times the book's cost.

The final chapter of the book covers patterns and approaches for developing managed packages and is definitely worth reading and re-reading if you are in that space. Dealing with the presence (or lack thereof) of Person Accounts, for example, is something I've never really thought about in this context, even though I have worked with a number of organisations that have this feature enabled.

A refreshing change for a book presenting development best practice was the recognition that:

(a) the point of professional software development is to make money, and
(b) developing solutions for individual customers on a consulting basis is very different to developing applications intended for widespread use

and thus your approach to writing code and tests needs to reflect this.

Finally, a few words for the less experienced. If you are relatively new to the Apex programming language, you'll find large parts of this book a struggle. However, there is one chapter that every Apex programmer should be made to read before being let loose on a live organisation and that is chapter 3 - Limits. Limits are something that all designs should take into account, because regardless of how unlikely you feel it is that your code will ever be used in a way that would breach limits, you can't predict what will happen in the future and what other code yours will be forced to co-exist with. This chapter has some excellent examples of how code can fail to scale and what you can do to avoid this.

I learnt a lot from reading this book, more than I'd expected to, if I'm honest, and I'm sure I'll learn more when I use these patterns in anger and re-read chapters. I'd recommend it if you are looking to improve your Apex development skills (and if you think your Apex development skills can't be improved, then you should definitely read it!).

Saturday, 1 September 2012

The Other Side of Certification

As regular readers of this blog will know, I'm a big fan of Salesforce certification (in fact, I'll be talking about this in my Dreamforce 12 Community Commons session in September).  Recently my eyes have been opened to the other side of certification.

Over the last few weeks I've been helping out with the beta for the Salesforce Service Cloud certification.  While I've had plenty of experience of these exams from a candidate perspective, this is the first time I've been able to contribute back to the exams, and its been a real eye opener.

What has surprised me most is the amount of time that is involved - I've personally spent a number of days on this, and there are quite a few of people involved.  The effort that goes into ensuring the exam is accurate, worded appropriately and at the correct level is quite frankly staggering and way more than I was expecting at the outset.

As I've mentioned in an earlier blog post, the service cloud exam had to be withdrawn due to reports of questions and answers being publicly available.  While this was irritating for potential candidates, the impact on those involved with producing the exams must be orders of magnitude higher.  It isn't like a new exam can simply be churned out in a semi-automatic fashion by a dedicated team, rather these are created by subject matter experts from Salesforce and the wider community who all have day jobs and have to make time to do this.  Even more reason, if it were needed, not to capture questions and ruin it for everyone. Up to now, I've admonished people requesting questions and answers fairly mildly and tried to encourage the askee to make the effort to learn.  No more - now that I've seen first hand the effort that goes into these, any requests of this nature will be dealt with human torch style - flame on!

So next time you are taking one of the exams and feel like the questions are intentionally trying to confuse or trick you, keep in mind that nothing could be further from the truth.  They've been put together by a group of human beings trying their level best and in many cases doing it for nothing with the best interests of the Salesforce community at heart.  This is also something to bear in mind if you are tempted to capture and share the questions and answers.

If you are going to Dreamforce 12, you'll find the members of the certification team in the campground. If you are a certified professional, why not take the time to visit and maybe tell them how much you appreciate their hard work over what must have been a very difficult year - but for them, you wouldn't have any exams to take in the first place. I'll certainly be doing that - maybe I'll see you there.