Thursday, October 1, 2015

Even Small Companies Benefit From A Center Of Excellence Team

User adoption is a double-edged sword for some companies. As more users become more active on Salesforce, and as more departments find it to be the best solution for their needs, the more work administrators and developers have in keeping the system working the way users need it to work.

I've heard of companies that have such a large backlog of requests in Salesforce that by the time any work request gets cleared, the requesting user may no longer even need whatever they requested. Obviously pulling work requests out of a backlog on a First In First Out basis is not a manageable solution for anything much more complicated than user provisioning and password regeneration.
A governance team can help keep things running smoothly.

Instead, companies should consider implementing a more mature governance system like a Center of Excellence (CoE), or scaled down version in the form of a Success Team. This governance body for Salesforce orgs brings all the stakeholders to the table at once and provides transparency into the important issues each department is facing.

You may be familiar with scenarios of what happens without a CoE: multiple departments need customization work but the administrators and developers are stretched too thin to dedicate a resource to any project. In some companies, new requests simply spread resources even thinner across yet more work.

For example, the product department needs a way to mass input new products while the customer service department needs a smoother way to handle complex steps for authorizing a product return and credit. The admins and developers are stretched too thin to take on both tasks simultaneously. But that's what they are asked to do any way. And so both projects chug along ever more slowly without the proper attention to detail.

Instead, an active CoE can prioritize these requests based on input from administrator, developer and end-user representatives.  But the administrator has to be given a lot of say in the CoE decisions.

Special talents of any good Salesforce Administrator include the ability to understand your specific business processes and how they relate to Salesforce features and capabilities. Companies need to use that person's knowledge to put projects in logical order and give them a reasonable timeline. And in some cases, departments may discover that their needs overlap and the administrator can accomplish multiple tasks at once.

Nightmares of No Governance

One administrator I worked with had multiple departments needing a way to combine records into various related groups. A simple addition to the data model and Heroku Connect settings could have made that possible, but coordinating with three departments for a solution required getting everyone together to discuss. That is the most difficult part of projects without a CoE.

In this example, the administrator had built out and populated a model that no one was using. The administrator had been working with customer service, but that department had turned its attention to fighting other fires.  The product department was at a loss about how even to put a request together for configuration changes in Salesforce and had a terrible relationship with IT.  And the marketing department did not know they could simply use Heroku Connect to pull the data they needed from Salesforce into their web app. The administrator and developers didn't even have a way to communicate to users that solutions were complete because they did not have User Acceptance Testing scheduled.

I've also worked with CIOs who make purchasing decisions based on demos rather than actual product testing in Sandbox. These CIOs expect administrators to configure ill-conceived or undefined solutions with untested products. Yet a CoE can create well defined functional requirements enabling the administrator and select users to conduct basic testing before purchase decisions in order to determine how new packages interact with existing systems and whether they address basic business needs.

Simple Efficiency of Teamwork

Rather than setting your projects up to fail by not allocating sufficient time to them or setting up your company to fail by pitting departments against each other to fight over limited internal resources, set up a CoE to handle these issues in a transparent way. Discussions can be continued in Chatter and resources can be shared in Content Libraries or Chatter Files for full disclosure to Salesforce users. Proper governance records why decisions were made, which keeps your company from spinning its wheels revisiting decisions when there is no new information.

The beauty of the CoE is that it can be scaled to meet your company size and needs. Start with an executive sponsor and department managers who are using Salesforce as well as administrator and developer representation. Add a couple of power users and training experts. Schedule meetings and combine them with an online Chatter group to continue any open discussions. You will find that this can help equally with the initial roadmap of Salesforce projects and ongoing collaboration as well.

When projects require outside vendors, there should be an administrator in all meetings with the vendors to ensure that the business and user needs are well defined for your vendor partner as well as for anyone responsible for in-house support and maintenance after the project goes live.

Once departments start sharing how they are using Salesforce, they may even inspire each other to make better use of data that is already in the system.

Saturday, September 26, 2015

Build Teams, Not Committees

Being part of a committee makes everyone cringe, but being part of a team can bring joy. If they are both just groups of people, why do they make us feel so different?  Use this simple comparison chart to understand why your company should rethink committees and focus on team building instead:



One clear leader, the head coach, who brings everyone together and is ultimately responsible for success or failureNo clear leader and no mechanism to unite members
Additional leaders empowered at every level of the team including skill-specific coaches and team captainsPower struggles and power grabs when leadership is unclear
Team members have clearly defined positions and roles for working togetherMembers may not understand their contribution
Defined timeline and ways to measure success throughout the season, as well as pre-season and post-season expectationsVague goals, arbitrary timelines
United against an opposing team or united for a singular achievementOpposition often comes from within the committee and personal goals take precedence
Well defined tasks for each and every time the team gets together come in the form of practice routines, game plans, and even a task to share fun with pizza socials after gamesMeetings may be scheduled in advance but members may not know what they are intended to achieve, agendas and summaries may not be offered to members
Keep members motivated and acknowledged for their efforts and achievementsFail to recognize the value members bring and their individual contributions

Simply reclassifying committees as teams is not enough if you lack motivating leaders and empowered members who are trusted to execute their well defined tasks and coached on paths to improvements when they fall short.  We like sports metaphors because they generally make us feel good about ourselves and others, work should be able to do the same.

Saturday, September 19, 2015

Struck By Lightning, Now What?

We have all seen the new Lightning user interface by now and while it currently effects the way sales teams and admins interact with Salesforce, we can start planning for a broader implementation right now.  Lightning provides for a modular page layout that we can configure for our own processes and dynamic components including a Kanban board layout and interactive charts, among a lot of other cool features.  And it represents a big change in the way users can view and interact with data in Salesforce, whether sales users today or every user as new releases become available.

As you consider rolling these new features out to users, here is one process you might consider:

Step 1, Learn

Trailhead offers learning modules to help
with smart implementations.
Recruit some super users to play with Lightning Experience in a Sandbox.  Find enthusiastic users that you know will have exciting ideas, but also have at least one of the more reluctant users.  If you have a user who is just not that into Salesforce, this could be a good opportunity to win them over by listening to what they need and letting them effect change.

As an admin/developer, start learning about Lightning App Builder in Sandbox or in a developer org.

Of course, everyone should go through Trailhead modules related to Lightning.  End-users might want to start with the features module.  Admins and developers both can start creating apps to become familiar with features and limitations.  At Dreamforce 2015, there were already 17 Trailhead learning modules available that you could find with the Lightning tag filter.

If you have not set up a CoE (Center of Excellence or Success Committee) in your company to bring together representatives of each department using Salesforce, this would be a good time to put that group together and start planning as a team how to bring Lightning to users in each department.

Evaluate some of the Lightning Components from the AppExchange and see if there are any quick wins you can bring to your users or inspiring solutions that may already be available.

Keep mobile in mind as well.  The Lightning user interface works well across all devices and if you have not considered the mobile user experience, this is a great time to learn more about it as well.

Step 2, Plan

Meet with your super users and your CoE to workshop ideas about what may be the best way to design page layouts but make it clear that this is a way to gather ideas, not all of which can be implemented right away. This is a time for generating wish lists rather than worrying about actual final product.  Let users dream up their ideal page layouts but keep realistic expectations, their ideal may be unattainable, but it should help you understand their needs and goals to work towards a better middle ground.

Give each user paper and have them draw out what they would like their page layouts to look like now that they have seen what could be possible with Lightning.

After you give users a chance to draw up their own ideas, give groups of users who perform the same job function the chance to work as teams to combine their ideas on a whiteboard or, better yet, on a poster board you can keep as a reference.  Try to have multiple groups of users each create a board and then have the groups come together and discuss why they designed the page layout on their board the way they did.  As they discuss their ideas, they may want to make changes and you should be able to discover some of the most important concerns and requests.

During the planning phase, admins and developers at your company should also conduct a workshop, or internal hackathon.  Create a new Sandbox Idea Factory where they can put together ideas that they think might benefit the company or the individual user experience as well as ideas that simply interest them as a challenge.  This is a great place to promote creativity and inspiration and bank resources that may come in handy for development.

Step 3, Develop

Create a project plan that merges the most workable options from your Idea Factory with the most desired and manageable requests from user workshops.

Keep the channels of communication open as you execute this project plan.  Whether you use Agile or other project management methodologies, it is important to make sure everyone understands the immediate goals as well as the more long term goals.

Keep meeting with your CoE to make sure they are behind the development efforts and aware of timeline, progress and roadblocks.  You want to ensure that the users are kept in the loop during the development cycle so that they don't feel forgotten or get the wrong impression that their ideas from the workshop were merely dismissed.

Make sure your super users from the learning phase are still involved with user acceptance testing and helping with creation of training materials and best practice guidelines as you develop those as well.

Step 4, Implement

Now for the fun part!  With the support of your super users and your CoE, start rolling out your customizations to users. Make sure they have the training and support they need for a good start with your custom Lightning user interface.

Step 5, Evaluate

Listen to your CoE to discover what worked well in the process and determine what changes you can make to these steps before beginning the process again.  When you start the next learning phase, you might consider introducing your users to some of your favorite ideas from your internal Idea Factory as well as new Salesforce features they may not be using yet.

This initial Lightning release affords us all time to work with users and plan how to meet their needs. If we start now, we can create a process that will make transitioning to the new user interface a chance to impact user adoption as well.

This is just the beginning.  With three releases a year, Salesforce will have more features coming available so keep your Idea Factory Sandbox active to give admins and developers a place to challenge themselves and stretch the capabilities of the org.  And let your CoE continue to support project planning and generate enthusiasm among end-users.

Thursday, September 10, 2015

Salesforce Lightning And Juggling Ideas Together For Rapid Development And Rapid Training

When you employ rapid development techniques, you need a documentation and training tool that can quickly introduce new capabilities and concepts and later allow you to expand on that knowledge with added content. Salesforce uses Trailhead as that online learning tool to introduce users around the world to new features associated with the Lightning Experience and other platform capabilities.

While Salesforce's traditional documentation and training resources contain a multi-course buffet of information, Trailhead provides resources more comparable to a delightful cocktail party. The content is lighthearted and approachable and comes in bite-sized portions that are quick and easy to consume.

For developers and administrators who want to gain familiarity with the new Lightning Experience before unleashing it for end-users, Trailhead offers a great introduction with four new badges (pre-Dreamforce '15): Lightning Experience Basics, Features, App Customization Lite, and Rollout.

Being able to offer training content quickly and update it easily has been a benefit of Trailhead, a unique and innovative free training offering from Salesforce.

For the team involved in creating Trailhead, customer enthusiasm for the training modules has been rewarding. "I've never stumbled onto anything this big," says Josh Birk, Developer Evangelist at Salesforce and the developer behind the initial Trailhead prototype. According to Josh, "this last year has been the best year of my career for being part of a team of people with such a passion for improving customer experience."

We can learn from more than the content since, as a project, Trailhead has a lot of lessons to teach businesses by example.

According to Josh, "At Salesforce, we aren't just trying to make things work, we are trying to make things work better." In this case, Salesforce executives lent their support when they discovered multiple groups working independently on an area where the company was already doing good work, according to customer feedback, but individual employees had a desire to move beyond good to great.

Moving a product from good to great might seem like a luxury to companies that are stingy with resources and believe success comes from doing what you did well once before, years ago. Companies like that typically suffer from business short-comings like risk-aversion, groupthink, management by perkele, and bystander apathy resulting in management that gives a cold shoulder to new ideas or any ideas that don't come from the top down. But the culture at Salesforce avoids all of those pitfalls.

Josh feels lucky to work for a company that supports compelling ideas born from employees asking themselves "what if we could give our absolute best?" In this example, Salesforce executives demonstrated their interest in helping employees achieve their best by encouraging their efforts.

Executives knew that multiple people were exploring good ideas and gave those people time to collaborate on what they were all trying to achieve. Managers guided the teams to discover how they might fit their ideas together. Open collaboration is part of the Salesforce culture to keep moving forward, keep progressing and keep being innovative.

For Josh and others working on creating Trailhead, their original ideas to give their best sprang from interactions they had with individual customers. Face-to-face at workshops, online in the Chatter communities, everywhere they found customers, they took the opportunity to think about what might make things better for each of those individuals.

According to Josh, "our approach was not looking at what other companies were doing but instead looking at what our customers needed." What started as a tool for on-boarding new administrators and developers is evolving with new content for more intermediate and advanced users, and of course offers new content around release features like Lightning as well.

For administrators rolling out Lightning Experience, these lessons in collaboration can be applied to the roll out. With the limited Lighting Experience available in the Winter '16 release, we have time to conduct workshops with users and brainstorm on what Lightning has to offer our teams to help them achieve their best. As administrators, we have the opportunity to juggle these ideas together into improvements for our companies as long as we welcome ideas from end users and think about making things better for them as individuals.

To hear more about Trailhead and innovation, sign up for Josh's session at Dreamforce 2015: Making of Trailhead in Moscone West.  

Saturday, August 22, 2015

Nurture Creativity, Passion And Collaboration To Be Innovative

The Salesforce Trailhead online training modules are inspiring a lot of us to learn new features and exercise what we already know to earn points and badges. And to have fun with Salesforce. There are modules, or trails, specifically for admins or for developers and trails for specific activities like learning about Event Logs. There is even a trail for getting ready for Dreamforce.

These are definitely worthwhile exercises for anyone interested in encouragement to practice new skills. Once you get started, they draw you in with virtual rewards that inspire continuing with a just-one-more goal. And the list of trails is growing at great speed to ensure that just-one-more goal offers something new and different.

I wanted to explore how this popular project came to be so that I can encourage that kind of innovative thinking among my teammates. So I interviewed Lauren Grau, Developer Relations at Salesforce and a member of the Trailhead team, and here's what I learned.

According to Lauren, the Developer Marketing group was looking into ways they might improve on the existing training workbooks. While these were popular for learning Salesforce, they didn't always provide a clear path or define a way to progress beyond introductory steps. It was also difficult for the folks at Salesforce to gauge the usefulness of any particular workbook. Were people getting stuck? Were they making mistakes?

Coincidentally, while that group was looking into improving the workbook training experience and exploring new tools like those from Udacity, one of the developers on the Developer Evangelism team, Josh Birk, was working on a side project called "Medals". Josh intended to demonstrate using the Metadata API to verify changes in an org based on steps in training. As a group, Developer Evangelism is all about coming up with cool uses of the platform to inspire people and Medals was another project intended to inspire developers with the power of the Metadata API.

According to Lauren, this kind of creative exploration is not limited to any single team. Salesforce is willing to help "carve a space" for projects that employees are passionate about and the company is filled with people who are passionate about Salesforce products. Salesforce has even encouraged that sort of creativity with project challenges that eventually get released as Salesforce Labs applications on the AppExchange.

While marketing had started creating learning paths based on roles and flow charts of the "known universe" of the platform, the demo of Medals was catching fire among all who saw it. In some companies, these two efforts would continue on their independent paths, but at Salesforce, collaboration and alignment across departments is a huge part of the culture. They use Chatter to connect people and ideas and have a "great open door policy" according to Lauren.

This combination of technology and policy helps Salesforce overcome barriers to innovation that other companies find insurmountable. As a result, the people who could bring together the two teams, marketing and evangelism, did so, and brought in the documentation team as well.

The people involved in Trailhead are passionate about solving the problem of helping Salesforce admins and developers with the task of keeping up with the cloud. With Trailhead, Salesforce can provide training that offers real-time feedback and does not require switching back and forth between disparate systems like workbook and computer to execute training steps. The gamification elements ensure that training is fun and addictive while well-thought-out projects and paths make the skills taught even more meaningful.

Luckily for all of us who enjoy the training modules, Lauren tells me "there is still a lot we haven't gotten to do with Trailhead that we've got planned". New learning trails and badges are on their way, expanding beyond the platform to other clouds as well. There will also be trails for end-users. Just imagine pointing users to Trailhead for learning and relearning tasks like running reports and using filters to see just the data they need.

If you have ever wished you could create your own learning trails for Trailhead, you will get your chance as Salesforce expects to harness the power of its incredible community for content creation and review. Beyond that, we'll have to wait and see what ideas develop thanks to Salesforce nurturing creativity, passion and collaboration so that fun and innovative projects like Trailhead thrive.

Sunday, August 16, 2015

Rethink Salesforce Projects With Great Administration Techniques

System administrators are getting more tools with even greater power with every new Salesforce release.  Tools like Lightning App Builder, Process Builder and Visual Flow work like visual programming tools.  They offer clicks-not-code solutions that can bring down project costs of time and expertise by eliminating the need for developer involvement in the creation and maintenance of all but the most complex projects.

This year at Dreamforce, I will be helping admins learn skills they can use to better plan and implement projects in their orgs.  Please look for my sessions here:

Getting To Know Visual Workflow (Tuesday session)


Getting To Know Visual Workflow (Thursday session)

Choose either of these sessions to learn about this powerful tool.  It requires no coding experience to use, but works like a visual programming tool enabling you to improve user interface and user experience, manage data consistency and integrity, and automate business processes without needing to write any code.

7 Essential Tips Every Admin Should Know About Apex

Whether you are working with in-house developers or hiring contractors, learn what to look for to ensure the code you are getting follows best practices and meets your needs.  This session will introduce you to concepts that will help ensure the overall health of your org and help you to work better with developers.

Trailhead Gladiators

Join us for these fun sessions on Tuesday, Wednesday, and Thursday to discover how Trailhead helps you stretch your skills.  You may be able to win prizes, but best of all, you will see what Trailhead has to offer as a learning tool.  And with more knowledge, everyone's a winner.

Friday, August 7, 2015

Some Projects Deserve to Die

A vendor on one of the Salesforce projects I was designing said to me: "Some projects deserve to die."  He wasn't talking about our project, which deployed on time with great features, but I was still shocked.   Why would a project deserve to die?  And how do you know when you are working on one of those so you can help ease it out of existence?  If you think of your in-house projects in terms of investments, you can categorize them:  cash cow, rising star, mouse trap, and dog.

In-house tech projects can be seen as cows too.
The best categories for a project are cash cow and rising star.  Cash cow provides great user experience at low expense with regard to time, and expertise. They offer high return on investment, or ROI, for that reason.  The cow represents everyone's favorite technology, users love that it does what they need and you love it because it doesn't require a lot of upkeep.

The rising star is in-house tech in-the-works and has high needs for time and expertise with low ROI during early design, configuration, and implementation stages because users aren't getting much benefit yet. Even with low or no ROI during this development cycle, the rising star is expected to become a cash cow when it is closer to completion and once users are trained.

The two project categories that need reconsideration are the dog and the mouse trap.

The Mouse Trap 

Then there are the mouse traps.  These projects have a high ROI, but the maintenance costs are also high -- they are like Rube Goldberg inventions in complexity and while they may have gotten the job done as conceived, users are outgrowing them and finding flaws.  These projects deserve to die.  These in-house projects are integral to users, yet too costly to maintain.  And having a project that lives in the high maintenance, high expense side of the quadrant can't be a good thing.

cash cow, mouse trap, rising star, dogOne company asked me for help with their mouse trap.  They had so many custom objects making up a customer survey that they required custom Visualforce pages for reporting and couldn't leverage the flexibility of Salesforce standard reports.  What they could have accomplished with clicks-not-code if a Salesforce administrator had been involved in designing the original solution got bogged down in complexity and code making it completely inflexible -- not a good trait for business solutions.  Code edits were required for any meaningful changes to the reports.

At some point, the money poured into this project had been made good through ROI because the Visualforce reports are so integral to their business, but user needs have changed and the solution doesn't work as well as it should now.  As complaints and change requests rise, so do maintenance costs in time and expertise.  Rather than spend to maintain, in this case, it makes more sense to spend on a redesign to reduce maintenance costs long term.  These mouse traps seem useful, but these are the projects that deserve to die.  Users wish they could do more with the integral tech, but the complexity of it makes expanding functionality just too costly considering time and effort.

The Dog

Your dog may need updating.

For in-house tech, a dog is a product with low maintenance costs that has low ROI. It's the infrequently accessed tech or is used by a small audience, it might even be a quick fix you created to help a single user.  The dog, with its low maintenance and low ROI seems like it has nothing going for it, but in fact these projects can lead to easy wins.  Do they just need to be promoted in house to make the use and value better understood?  Can they be nurtured to grow into a rising star by interviewing users regarding ways to improve what the tool does without a lot of expense?  Some in-house tech just seems to get stuck in phase I, minimum viable product, and needs a nudge to get going in the right direction again.

These dog projects, with low cost and low impact, offer opportunities to explore easy solutions.  I did a creative side project for the Little Bits Olympics recently that didn't make it out of the dog stage.  The project description suggested two hours for the project, so that's what I spent. This time budget limited my choice between using a rare earth magnet attached to a servo to alter its polarity versus an electromagnet that required more effort to hack into my Little Bits electronic circuit.  Because of the time budgeted (like any expense), I chose to test the quick approach and was not completely satisfied with the result.  The ROI was low, the cost was low, it was every bit a dog.  But it did work and gave me great preliminary knowledge for planning phase II which will have an electromagnetic bell type design once I budget the additional time to hack the circuit.

Consider the dogs in your org and look for ways you might be able to teach them new tricks or make them more relevant to users.  And as for the mouse traps, don't get caught by them, a lot of people want to continue to throw resources at outdated solutions to try to convert them to cash cows, but the best approach might to be to let these projects die and start something new to take their place that will offer easy maintenance at low cost relative to time and expertise.

Saturday, August 1, 2015

Mistakes Small Companies Can Avoid When Working With Consultants

If you are considering bringing in help to work with you on your Salesforce implementation, make sure you have executive support for your project as well as a dedicated internal resource to own the project when it is complete and to nurture it along the way.  Make sure that the people (or person) responsible for upkeep and support of the completed project are involved early in the roles of tech lead and business analyst and that they approve the approach that they will ultimately have to support.  
Working with a consultant shouldn't be like
swimming with sharks

Those are the most essential requirements for a successful project, but you can avoid costly errors by considering the following suggestions as well:
  1. Get a signed NDA.  Your data is valuable, your code is valuable.  You are turning complete access over to someone who should be happy to sign an NDA.
  2. Understand your data before giving access to it.  You should know your data and have a written plan for maintaining data quality (such as best practice documents and descriptions of validation rules, workflow and triggers) or at least a plan for improving data quality (can you describe what you think of as duplicate data?). 
  3. Start writing a specification for what the business should be able to accomplish when the consultant is finished and how users will be interacting with whatever the consultant implements.  Even if all you need is to have a few third-party apps installed, you should describe user access and data interactions you expect to see and define the business process you hope to address. 
  4. Get the travel costs and incidentals spelled out, including maximums you are willing to pay.  And agree up front whether meetings need to be in person, or can they be online. 
  5. Document in the contract who owns any code and what they can do with the code going forward.
  6. Question their recommendations, most consultants want you to be an active partner and understand the work they are putting in for you.  Questioning offers a chance for early resolution if you can uncover a mismatch between their understanding and your reality.  At the very least, you stand to gain a better understanding of the solution they are offering.
  7. Trust the consultant once you decide to hire them.  Not trusting your consultant is evident when you hold back information or limit their access to users and decision makers.
  8. Make sure your company understands a project's functional specifications.  What is the minimum you expect the consultant's work to accomplish for you and how will you recognize when it is complete?  Involve end users and management both in this process and document their needs and processes in order to guide them through User Acceptance Testing.  Highlight for users the holes and pain points that are being addressed so they will understand the purpose of the project and what it looks like when complete.
  9. Specify the project goals and how you will measure their success.  What is it that you hope users will accomplish and how will you measure user success.  For example, if you want users to be able to map their accounts and find nearby accounts when they are on the road, you can try to measure how often they use the feature, but you are probably more interested in whether more accounts are being visited on each trip so the latter is a better measurement of success.
  10. Ask your consultant which vendors may be paying your consultant to sell their product into your org.  Ask them to disclose any commission they would be eligible for at the time they recommend those vendors.  There is nothing wrong with commissions, but you may want to independently look into some competitive products for your own understanding of the value of the suggestions your consultant offers.

Tuesday, July 14, 2015

Agree on Guidelines Before Adding Code

Remember how your high school and college research papers were graded partly on niggling formatting concerns?  The point was to make sure we all used ibid, idem, op. cit. and loc. cit. correctly.  By getting us all following the same style, the teacher had an easier job understanding our work and we learned to better understand the work of others.  These are the same reason you should define code guidelines for your Salesforce org.
A good style guide provides grounding
without weighing you down.

Whether you are a Salesforce Administrator who works with vendors for your development needs or an in-house developer yourself, documenting basic code style and guidelines for your org should be considered a must.  Code guidelines help ensure that the code can be maintained for years to come and that the org is well documented down to the code level so that admins and developers alike have a thorough understanding of what takes place in the org.

A lot of Apex programmers start with the Google Java Style Guide, which is a great starting point, but you may want to create something brief to share among everyone writing code for your org.  Here are some suggestions for a brief Apex Style Guide:


  1. Avoid unnecessary whitespace.  Whitespace is helpful for indicated blocks of code, using indentations at the beginnings of lines or blank lines before methods, for example.  But whitespace inside of lines of code adds to maintenance time.
  2. Use tab rather than spaces for indenting lines of code to ensure they line up properly and reduce character count.  Indent lines of code within a method by one level from the method.  Indent the code contained by a loop by one level from the line that sets up the loop, for example.
  3. Limit code to 100 columns wide, even in comments so that it can be read without scrolling.
  4. Break SOQL statements into multiple lines with new lines for each clause: From, Where, Order By, etc.  Selected fields should be listed in ascending alphabetical order.

  5.   Map<id,account> aMap = new Map<id,account>([SELECT Id,Name 
                                                  FROM Account 
                                                  LIMIT 50000]);

  6. Comments should appear at the beginning of every class and at the beginning of every method in block format (/* */).  
  7. At the beginning of each class, comments should
    • describe purpose and list related files (classes, triggers, components, VF pages, etc either called by or that will be calling this file) as well as HTTP services called, if any
    • list author name(s) and creation date
    • include modification dates and authors and purpose of modifications
    • list business processes in order they are addressed in the code as a brief summary of methods.
  8. At the beginning of each method, comments should
    • Describe purpose and detail parameters and returned values.
  9. Trigger logic should be contained in at least two files: the Trigger and the Handler(s) containing the business logic.
  10. All code should be ‘bulkified’ to avoid exceeding governor limits when multiple records are processed, at the very least, SOQL and DML statements should only appear outside of loops.

Naming Conventions

  1. File names should begin with a Primary sObject name, followed by a description of the action the code performs, followed by the type of class (eg. Controller, Extension, Helper, Utility, Test, Trigger).  For example, you might have the AccountAddressUpdate Visualforce page and the AccountAddressUpdateExtension controller extension.
  2. Avoid spaces and underscores in file, class, method and variable names.  Also avoid abbreviations when possible.  
  3. Method names begin with a lowercase verb.
  4. Classes should use camel case (eg. CamelCase) while Methods and Variables should use nerd case (eg. modifiedCamelCase).  You could have a controller extension class called AccountAddressUpdateExtension with method updateAddress and variable newStreet, as an example.
  5. Use all caps for constants such as MAXIMUM and MINIMUM.  Constants should be placed after the class header comments and before the first method and method header comments so they can be easily located and updated.
  6. Append “Test” to the class name for all test classes.  For example, the class AccountAddressUpdateExtension would have a corresponding AccountAddressUpdateExtensionTest. 
  7. Collection variables should be plural or otherwise represent the fact that they represent a collection (eg. recordMap, newAccountMap).


  1. Remove System.debug statements before pushing code to production.
  2. Require positive and negative scenarios in unit tests using assertions that are clear. 
  3. Salesforce defines minimum code coverage as 75% but we prefer minimum code coverage of 90%.


  1. For integrations, employ a 'single source of truth' model where possible—data should be stored in one location and referenced by other systems or pulled on an as needed basis only. A redundant system should be created for backup purposes, but should not be used as a data source except in the event of failure recovery. 
  2. Follow the rule of 3 and the abstraction principle. If the same code is used 3 or more times, it needs to be implemented as a reusable class, method or loop. Programmers sometimes refer to this as DRY v WET : "Don’t Repeat Yourself" vs "We Enjoy Typing"). Create abstract code for reusable procedures.