Skip to content
Amit Singh edited this page Apr 20, 2021 · 2 revisions

Salesforce Utils

This repo is maintained by Amit Singh aka SFDCPanther. The main purpose of this repo is to put all the reusable utility which I have developed so that all others can use them. If you wanted to contribute you can also contribute. How to contribute, check the below steps for the same.

Features Uploaded - 11 April 2021

This repository contains the following features

To contribute your utility must qualify below criteria.

  • Utility must be reusable
  • All the Classes, Triggers must have test classes and test classes must cover at least 85% of your code.
  • Your Utility folder must contain a ReadMe.md file with the steps to use the utility. ( If possible create a small video )
  • You must follow the best steps to use your new branch to develop the utility.

Clone the repo to your Local PC.

The very first step is to clone this repo into your salesforce rep. Use the below command. git clone https://github.com/amitastreait/Salesforce-Recepies

Create your own branch in the local machine.

Once you have cloned the Repo into your local machine then create a new branch for your utility. The branch name should follow the naming convention like below. If your name is Amit Singh and your utility name is lookup then the branch name should be lookup-amit-singh. You can use the below command to create your branch. git checkout -b lookup-amit-singh

this will create a new branch and will switch you to your new branch.

Create a Separate Folder for your Utility

  • Now, the next step is to create a separate folder and the folder name will say the name of your utility. For example custom lookup.
  • To create the folder, go to the folder where you have cloned the project and open it. open sfdxsrc folder and then create a new folder and the folder name should be based on your utility.
  • Your parent Folder will contain the subfolders to store the metadata. For Example, this parent folder will contain the subfolders. objects, lwc, classes, static resources, etc.

Folders Path

Modify sfdx-project.json file

The next step is to modify sfdx-project.json file. Open the project in your VS code and then open the file. Add a new path for your new folder. For Example, the folder name is custom lookup then a new path should be

{
   "path": "sfdxsrc/customLookup",
   "default": false
}

Project Path

Push the changes to your branch after the utility has been developed

Once you have completed the development of your utility, push the changes to your branch. You can follow the below set of commands to push the changes.

  • stage all the changes using git add . command. Note -- Please make sure you push necessary changes only.
  • Commit all the changes to your local branch using git commit -m "A valid message here that make sense"
  • Push the changes to your branch using git push -u origin yourBranchName. For Example, your branch is lookup-amit-singh then the command will be git push -u origin lookup-amit-singh

Create a Pull Request to merge all your changes.

Now, the final step from your side is to create a Pull Request from your branch to Master Branch.

Final Review

  • I will review the changes and if everything is ok, I will merge the branch with the master branch and you will be notified via email.
  • If there are any issues, I will create an issue and assign it to you.
  • You can resolve that and then again commit your changes. this time you do not need to raise the pull request.