Think. Build. Salesforce Solutions.

Salesforce Consulting Services across Salesforce Clouds & Across App Lifecycles

Blog

Salesforce coding project – Development best practices in Six Steps

By |2021-01-27T04:28:50+00:00January 19th, 2021|

You are a developer in a new Salesforce project. Or you are a CIO that is curious about the journey that your organization is about to take on Salesforce platform with more rollouts planned after your marketing/sales teams went live. Even if one Apex class is used, let us call it a coding project. You may use for simple purposes to achieve skill-based-routing in Einstein bots deployed to Salesforce omnichannel. More complex code is written if you are going for full customization work involving daily batch jobs or custom application user interface development in Visualforce, Aura Lightning or Lightning web components.

Most implementation projects done are agile. A developer does not always get a fresh new project to work on. So, the steps below assume that a developer is given a user story to work on an ongoing project.

Following are the six steps you can follow.

Salesforce Coding Project

STEP 1: Understand the story

1. Read acceptance criteria: if your stories do not call out acceptance criteria clearly, speak with your product owner or scrum master.
2. Think from end user perspective: think of the benefits the user will get from the feature that is to be developed in the story.
3. See if everything makes sense: see if the story connects with other stories in the Epic and the whole epic makes sense after all.
4. Complete the story by asking the right questions: not all stories ask these questions explicitly. Have a checklist and ask these questions:

  • Which all profiles can have access to this feature (if it is something that end user can access)?
  • Will they all access the same way?
  • What are the performance requirements for this feature?

5. Understand the features/epics dependent on this user story and the features/epics that feed into this user story
6. What are the new/complex technology areas used in this user story?

STEP 2: Understand existing code base

1. Understand the relevant entity relationships (i.e., ER diagram)
2. Understand all the access points for this epic and this story specifically: Sales/service cloud, Community portal, Marketing cloud, Batch job, etc.
3. Is there something built already? If yes, understand purposes of those existing components and their working. How are they composed together in the backend? What are the Lightning components, Apex classes, triggers, validation rules, Process builders, etc. working behind the scenes?

STEP 3: Plan how you want to build

1. Will you have new Lightning components? Then provide an outline for their need and how the class behind will support
2. Are you planning any object changes? Any other metadata changes?
3. If there are changes to be made to existing Lightning component and existing Apex code, detail what changes are planned.

STEP 4: Create Development Subtasks

Let us take an assume it is some UI-initiated functionality. Now, how can we go about creating the subtasks?

1. Write down all the UI actions that need to be coded. Divide UI actions into ones that need to refer to Apex/object in the backend and ones that that can be just tackled within the JavaScript in the frontend.
2. Have Estimates and target time to complete each of the internal action listed above

For each of the UI-only actions

  • Write down how the UI/JavaScript changes that will be needed.

For each of the UI+backend actions:

  • Write down what Apex has to provide. Mention if new methods are needed in Apex or if changes are expected in logic of existing methods or if any signature change expected in existing methods.
  • Write down how the UI/JavaScript changes that will be needed

3. Let us look at an example: On Load of screen, we need to show a custom filter that includes a picklist and two date input text boxes with a Go / Reset button (see screenshot below). Every time the user runs a query, we save the query information in some custom object; if user clicks Reset, we clear out this information. Imagine that this section is added to an existing custom Lightning component that displays all data in a Lightning datatable pertaining to this entity.

Salesforce Coding Projects

Subtasks & Estimated

salesforce coding projects

4. Remember to do unit testing along with every step
5. You will need Apex Unit tests to be written for any new Apex code written as well. If you are using LWC components, you need Jest unit test as well

STEP 5: Speak with your team before you build

1. Speak with your Lead about your design and plan
2. Speak with your Business Analyst / Quality Analyst to see if they have any other scenarios in mind.

STEP 6: Complete development

1. As you complete development, remember to note the meta data changed for this story. Depending on the process your organization uses, you will document it suitably in JIRA or other places so that your Lead can pick up your work for review.
2. Update design document and API document that you would have to reflect the changes that you just made.

Summary

Salesforce likes to tell all greenfield customers that Salesforce is a platform that you can achieve a lot without coding. It is true. Apart from the ability to customize Salesforce implementations, Salesforce does exist as a development platform that can be used to build any kind of application. You know it already if you are a Lightning web component developer customizing Salesforce platform. In the above article, you can see how you can approach a new custom development story in Salesforce and complete it to the satisfaction of all the stakeholders.

 

Leave A Comment