
Tekunda Team

Tekunda Team

Before diving into Salesforce development, you need to set up your environment. This involves installing the necessary tools and configuring your Salesforce project.
If you're looking to simplify the complexities of these processes so you can focus on innovation rather than process management, we've got the solution for you!
Start free - no credit card and be among the selected to leverage Tekunda Serpent to transform your workflow!
First, you need to install the Salesforce CLI. This tool is essential for interacting with Salesforce orgs, creating scratch orgs, and managing metadata.
Download the installer from the Salesforce CLI page. Follow the installation instructions for your operating system.
After installing the CLI, authenticate with your Salesforce org using the following command:
sf login
Create a new Salesforce DX project or navigate to your existing project directory. Initialize the project using:
sf project create --name YourProjectName
Scratch orgs are ephemeral environments that you can use for development and testing. They can be namespaced or non-namespaced, depending on your requirements.
Create a config/project-scratch-def.json file in your project
directory with the necessary configuration. For example:
{
"orgName": "Demo Company",
"edition": "Developer",
"features": ["Communities", "ServiceCloud"],
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"selfSetPasswordInApi": true
}
}
}
Use the following command to create a scratch org:
sf org create scratch --definitionfile config/project-scratch-def.json --setdefaultusername --durationdays 7 --alias YourScratchOrgAlias
If you're developing a managed package, you might need a namespaced scratch org. Namespaced orgs are particularly useful for developing and testing managed packages because they allow you to test your code in an environment that closely resembles your production environment. Here are some common use cases for namespaced orgs:
Ensure your Dev Hub has a namespace registered, and include the namespace in your scratch org definition.
With your scratch org ready, you can deploy metadata and code. This process involves pushing your local source to the scratch org and setting up any necessary test data and permissions.
Deploy your local source to the scratch org using:
sf project deploy start
Assign necessary permission sets to your user:
sf org assign permset --name YourPermsetName
If you have test data, load it using SOQL queries or by importing data files:
sf data import tree --plan data/sample-data-plan.json
If your project depends on managed packages, install them using:
sf package install --package YourPackageAliasOrId --wait 10
If you're looking to simplify the complexities of these processes so you can focus on innovation rather than process management, we've got the solution for you!
Start free - no credit card and be among the selected to leverage Tekunda Serpent to transform your workflow!
Effective source control is crucial for team collaboration and project integrity. Git is the most commonly used source control system in Salesforce development.
If your project isn't already under source control, initialize a Git repository:
git init
Add your changes to the repository and commit them:
git add . git commit -m "Initial commit"
Use Git Flow to manage your branches. Create a new feature branch for development:
git checkout -b feature/new-feature
Regularly fetch and merge changes from the main branch to keep your feature branch up-to-date:
git fetch origin git merge origin/main
After developing your feature, commit and push your changes:
git commit -m "Developed new feature" git push origin feature/new-feature
Open a pull request to merge your feature branch into the main branch. Ensure your code is reviewed and approved by your team.
Once your development and testing are complete, it's time to manage releases. This process can differ depending on whether you're working with a non-packaged org or a managed package.
Deploy your changes to the production org using the Salesforce CLI:
sf project deploy start --target-org YourProductionOrgAlias
Ensure all tests pass before finalizing the deployment:
sf apex run test --target-org YourProductionOrgAlias
Use the Salesforce CLI to monitor the deployment status:
sf project deploy report --target-org YourProductionOrgAlias --job-id <yourDeploymentJobId>
Create a new package version using the Salesforce CLI:
sf package version create --package YourPackageAlias --installation-key YourKey --wait 10 --code-coverage
Promote the package version to make it available for installation:
sf package version promote --package "YourPackageVersionId"
If your package will be listed on the AppExchange, submit it for a security review. This process ensures your package meets Salesforce's security standards.
Install the managed package in your production org:
sf package install --package YourPackageVersionId --target-org YourProductionOrgAlias --wait 10
Developing for Salesforce using the Salesforce CLI involves several steps, from setting up your development environment to managing releases. By leveraging scratch orgs, deploying metadata and code, handling source control, and managing releases efficiently, you can streamline your Salesforce development process.
Whether you're developing for a non-packaged org or creating a managed package, the Salesforce CLI offers powerful commands to automate and simplify your workflow. By following best practices and maintaining effective source control, you can ensure your projects are well-managed and ready for deployment.
If you're looking to simplify the complexities of these processes so you can focus on innovation rather than process management, we've got the solution for you!
Start free - no credit card and be among the selected to leverage Tekunda Serpent to transform your workflow!
Commitment free!