Salesforce Admin
May 26, 2021

9 Salesforce Development Best Practices

Learning to code might be dreadful for a few of us, but all of us would like to tweak something the way we wish. Salesforce CRM could be tweaked too! - with code and without code (just a few clicks) That sounds interesting right?

In this article, we will cover what Salesforce as a company offers to its developer ecosystem and we will check out some best practices to follow 

Salesforce Lightning Platform Explained

Salesforce Lightning platform is an application development platform wherein developers and non-developers could easily and fastly code apps. 

The drag and drop low-code tools within the Lightning platform makes app building process much easier and faster. They include Lightning App Builder, Lightning Flow, Salesforce DX and Heroku. 


Lightning platform also has inbuilt scaling, globalization, process automation, search and reporting capabilities which makes the life of developer so easy. For instance, the developer need not write HTML or CSS, they can use Lightning Style Library. Also AppExchange has a huge collection of apps and components, which can be reused by customers, so that they dont start from scratch. Salesforce has also made every attempt to make app development fun. Their trailhead empowers many developer’s careers with their free badges and guided learning tools. 

Salesforce is a trusted platform to build your custom applications or extensions. As of 2019, there are about 5.5M apps built on Salesforce platform. Trust is built into every layer of the platform - be it Infrastructure, Network or Application services. 

Salesforce Platform enabled us to build a low-code portal in one day and transform part of the institute into a COVID-19 testing lab.

- Alex Ehrenberg - Member, Innovative Genomics Institute Testing Lab 

Benefits of Lightning Features

In 2019, 37% of software developers in Forrester’s worldwide survey were using or planning to use low-code tools. By mid-2020, the survey predicts the number to rise to over 50% of developers

  1. Lightning has low code capabilities which helps even non-developers to build an application with little or no help. You need not hire a dedicated developer or expand the development team, even an admin could cross-work as a developer.
  2. For starters, you could build an app in days or weeks and not in months or years. The development lifecycle is reduced to a great extent. 
  3. You could develop customizations that make customers' lives easy and make the overall journey and experience a lot better. Also as a company they can digitize processes faster and use the latest technologies like Robotics, AI, etc.

Now that we know about the platform, let’s jump to what is Salesforce APEX

What is Salesforce APEX ?

APEX is a proprietary language developed by Salesforce themselves which lets developers execute flows, control statements on the Force platform along with Force APIs.

You can use APEX while creating web services for integration, email services for sending emails to customers, custom business logic/process, etc.

Their features include, 

  • APEX has JAVA like syntax which is familiar to developers
  • With APEX you could execute DML statements like INSERT, UPDATE, DELETE like SQL
  • APEX is strongly typed i.e., it refers directly to schema objects and their data types
  • APEX is built to run on multitenant environment 
  • APEX upgrades automatically when a new Salesforce release is out
  • APEX has built in mechanisms for unit testing. They suggest which parts of code is covered and can be better 

Development Best Practices

After the new developer experience. methodology - Salesforce DX came into picture in 2017, a lot of emphasis has been made on the development best practices. There is a lot of confusion too - which tools to use, how to plan, etc. 

DX includes Salesforce CLI, new sandbox - scratchorgs and use the best practices prescribed by Salesforce to do source driven development.

In this section we will cover a few general development best practices.  

1. Plan development activities 

Jot down where you are today and where you want to reach, followed by the development activities and timeline 

2. Understand Architecture first 

 You need to get a decent understanding of Salesforce APIs, architecture, database, schema before proceeding with development activities

3. Avoid Redundancy 

You need to be all eyes while writing code - not to repeat code. It might slip from your mind and you might trigger the same object over and over. 

4. Use Sandbox 

Every developer like you can leverage their individual sandbox wherein you can easily track changes and progress. There are different flavors of sandbox with or without data - Developer, Partial or Full, you need to use them wisely based on your needs.

Here’s a quick table with details of Salesforce plan and Sandbox. Don’t underutilize! 

5. Coding style

It matters a lot that you develop a coding style or follow naming conventions. Make your code easy to read and avoid complicated frameworks, libraries, etc. Add them if you only need them.

You can also set up code reviews, so that a new set of eyes views the code and suggest changes. This way there are lesser chances of production issues or down time.

6. Trigger Frameworks and Modules 

You can standardize your code using trigger frameworks. Also you could split the code into modules and check only the module which has errors (Divide and Conquer). These both can usually bring down development, testing efforts,

7. Apt Development tools 

This could be crucial. You need to pick the right tool for development based on your needs after proper evaluation of alternatives. 

There are paid and free IDEs available in the market. They include Welkin Suite, Illuminated Cloud, Eclipse/ IDE, VS Code, Sublime, Metaforce, etc.  

8. Test, Test and Test 

At any cost, you don't want to deploy a code that does not work or mess up your production system. You need to test that the code works in an intended way before going live 

If you have to test your code manually, it might take ages. You could have automated test scripts or tools to do the testing for you.

9. Document everything 

It’s human nature to forget what they have done after a while. It’s better to document everything while coding.  It can help other admins, developers or even yourself after a while.

You also need to have control over the changes and to be able to track, audit them for compliance purposes. If its non- compliant, you can roll back quickly and fix it. For rolling back, ensure you backup your meta data regularly.

Final Thoughts 

You can tweak Salesforce for your business needs with configurations to an extent. If at all, it's not possible with configurations, then there are customizations or custom applications where developers come to rescue.

You want the developers to make things better and not worse right? Your development team could be at top of their game too - only if you keep it simple, consistent and follow the development best practices continuously. Hope this article helped you with it!

CloudIdeas also provides development services too, you can take our help and just book a call today and get started with our Experts. 

About the author

Priya Ravichandran
Priya Ravichandran

Senior Consultant | Geeky Digital Marketer | Guest Content Writer

Priya Ravichandran is a consultant by day, content creator by night. Priya enjoys writing well-researched and easy-to-read business content. When she isn't typing or writing, she can be found backpacking or dancing.

Get great content updates from our team to your inbox.