This project is a collection of my Salesforce (small) coding projects. This collection comprises of multiple coded solutions that were created at different points and for different use cases. The metadata components may not fit together in the same org.
Don't deploy this project in its entirety. This repo contains multiple individual coding projects. I've created a sample empty package.xml file you use to deploy the identified related metadata components to your Trailhead Playground. Do not deploy any file to any Salesforce production org.
To refresh on working with package.xml using Salesforce CLI, review the Trailhead badge Package.xml Metadata Management. In that badge, you learn how to write xml and use package.xml to selectively deploy and retrieve metadata components in your Salesforce org.
The following tools were used to create this project.
Tool: | Version: |
---|---|
SFDX-CLI | |
VS Code |
Be sure to have Visual Studio Code (VS Code), Salesforce Extensions, and Salesforce CLI (sfdx-cli) installed before working with this project. This project uses the Salesforce Dev Hub feature and the command-line interface.
To refresh on Salesforce DX, review the Trailhead project Quick Start: Salesforce DX
To refresh on navigating the command-ine interface, review the Trailhead module Command Line Interface
- Install VS Code here: https://code.visualstudio.com/download
- Install Salesforce Extensions here: https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode
- Install Salesforce CLI here: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
- Enable Dev Hub: https://trailhead.salesforce.com/content/learn/projects/quick-start-salesforce-dx
- On your local machine, modify the sample package.xml file to include the related assets metadata (remember, to use the components API name).
- Save the package.xml under the apex-sample folder.
- In VS Code, open a new terminal window.
- Navigate to the apex-sample project directory in the command line:
cd apex-sample
- Deploy the metadata components to your Trailhead playground using the package.xml file.
sfdx force:source:deploy -x ./package.xml -u DevHub -w10
- Visually confirm the metadata components are in your Trailhead Playground.
-
AccountUpdate
--Description: Post a chatter message on a specific group with account information when specific criteria on Account is met. --Purpose: This trigger is really unnecessary. I needed a simple trigger that shows how to properly format code. This could be better handled in a flow. As useless as this trigger is, it was a bit of fun to create. AccountUpdate.trigger -
Create Chatter Post on Hot Account Updates
--Description:
--Purpose: CreateChatterPostAstroAccount.cls HotAccountUpdate.trigger HotAccountsClass.cls HotAccountUpdateTest.cls (unit test for HotAccountUpdate.trigger and HotAccountsClass.cls) -
Prevent User Leaving Mandatory Group
--Description:
--Purpose: PreventUserLeavingMandatoryGrp.trigger -
Remove Attachments GDPR
--Description:
--Purpose: CasesController.cls CaseGDPRUpdate.page RemoveAttachmentsGDPRTest.cls (unit test for trigger) RemoveAttachmentsGDPR.trigger -
Create Account Sample
--Description: --Purpose: CreateAccount.cls CreateAccountTest.cls
For details on using sfdx, please review the Salesforce DX Developer Guide.