Rob Cowell · 28th September 2023
Salesforce DevOps documentation best practices
Documentation is the lifeblood of any successful software project, but it often gets deprioritized. Writing comprehensive docs can feel like a thankless task when you're heads down coding new features. But putting in the effort upfront does pay dividends down the line when your future self or teammates need to understand the rationale and inner workings of your Salesforce org.
Why do comprehensive docs matter?
Here’s why comprehensive Salesforce documentation is important:
- Boost team productivity: Good docs help onboard new team members faster. Everyone can find what they need without asking basic questions.
- Deliver better business value: With processes and systems documented, teams spend less time figuring things out and more time delivering value to end users or customers.
- Enhance data quality: Documentation ensures data is entered and maintained accurately according to requirements.
- Improve collaboration: Cross-functional teams can work together more efficiently with a shared understanding.
How to organize your Salesforce documentation
There are several best practices that you should keep in mind when planning out your documentation strategy:
Consistency and simplicity
Adopt consistent naming conventions, organization of files/folders, markdown formatting, etc. Use plain language, organize things logically and be sure to follow templates and standards. Keeping things consistent and simple makes your docs easier to navigate and understand.
Comments in code, together with descriptions and help text for fields/objects are hugely valuable. Meaningful names and descriptions may feel obvious in the moment, but these will be a lifesaver six months later when you've forgotten why that field is called “whatsit”, and for your team members who don’t have the benefit of your memory!
Document early and often
Document as you go, don't wait until the end. Documenting throughout the development lifecycle saves time versus trying to reconstruct everything later.
Create a metadata and/or data dictionary
Catalog all custom objects, fields, relationships, validations, automation, and more. Automated documentation generation tools like ApexDoc and Elements.cloud are extremely useful. These tools create great baseline documentation so you don't have to start from scratch.
- ApexDoc scans your Apex code and generates documentation with info pulled from comments and annotations.
- Elements scans various Salesforce components and generates interactive documentation connected to your org.
Map processes and custom functionality
Capturing dependencies and relationships between components is essential documentation. Visual diagrams are incredibly helpful for complex systems with many interconnected parts. Your docs should make clear what depends on what, how all the pieces fit together, and the reasoning behind key architectural decisions. Adopting standards such as Business Process Modeling Notation can often aid clarity and make your Salesforce documentation consistent with other similar documentation for other systems within your business.
Use a document management system
Store docs in a centralized, searchable system like SharePoint, Google Drive or Notion. These can then be paired with non-technical documentation such as the documentation of new processes in how the system is used, perhaps in the form of Business Process Maps.
Regularly audit documentation
Review and update docs to reflect changes and ensure accuracy. Maintaining a record of why changes happened over time is also important. Reference ticket numbers from Jira, Asana or any other relevant systems in your commit messages so you can trace back to the original requirement or bug report that led to the change. These can then be brought together to form a change log, which provides a useful audit trail of documentation that grows and updates over time.
Capture technical details of third-party apps, ETL, and data flows. This will particularly support your DevOps documentation if you need to deploy changes across multiple systems.
Get team buy-in
The responsibility for great documentation does not fall to any single role. Whether you’re a product owner, admin, developer, or architect — we all have an obligation to contribute to and improve documentation. Effective collaboration leads to docs that actually meet the needs of multiple stakeholders and is one of the key drivers for DevOps success.
Consider a Salesforce Center of Excellence (CoE)
If your organization doesn't already have a Salesforce CoE, consider establishing one. A CoE plays a pivotal role in enforcing documentation standards and best practices across the business. They develop comprehensive guidelines and templates for technical, process, and end user documents, all of which are invaluable to a well-run Salesforce instance.
How can tools help with documentation?
While comprehensive documentation is crucial, manually writing and updating it can quickly become unsustainable at scale. This is where tools like ApexDoc and Elements.cloud shine by automating baseline documentation generation.
ApexDoc scans your Apex codebase and generates detailed documentation including:
- All classes, triggers, interfaces, enums
- Methods with parameters, return types, descriptions
- Code snippets
- Charts showing class relationships
Elements.cloud goes even further by scanning multiple Salesforce component types and generating interactive documentation connected to your live org.
Elements scans the following:
- Object fields with descriptions, relationships, schema
- Apex classes and triggers
- Permission sets and profiles
- Custom and standard tabs
- Record types
- Validation rules
- Page layouts
- Lightning pages
- Custom settings
- Custom metadata types
The auto-generated docs from these tools create a solid foundation that your team can build on top of, with deeper explanations, visuals, clarifications, and examples tailored to your project.
It’s a team effort
The bottom line is that documentation is a team effort and responsibility, but contributes greatly to your overall success with Salesforce. Utilize automation to get a head start, then collaborate to refine and expand the docs to capture essential tribal knowledge about your Salesforce system. Thorough documentation may not be glamorous work, but it pays back that effort many times over down the road.
Improve your Salesforce processes with DevOps
Effective documentation is a key part of Salesforce DevOps, which can significantly improve your release management process. To learn more about all the aspects that contribute to Salesforce DevOps success, head over to DevOps Launchpad. You’ll find plenty of free courses and certifications there to help take your Salesforce processes to the next level.