Follow these instructions to deploy Action Plans to your org.
AppExchange: The managed package is the best way to go - it will let you upgrade seamlessly as features are added.
Installing the App Using a Scratch Org: Fast and easy way to work with this app in a scratch org
Installing the app using a Developer Edition Org or a Sandbox: Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a scratch org.
Optional installation instructions: Installing sample Action Plan Template and other metadata
Action Plans: This is the best way to install the package, which you can easily upgrade as features are added.
-
Set up your environment. Follow the steps in the Quick Start: Lightning Web Components Trailhead project. The steps include:
- Enable Dev Hub in your Trailhead Playground or hub org
- Install Salesforce CLI
- Install Visual Studio Code
- Install the Visual Studio Code Salesforce extensions
-
If you haven't already done so, authorize your hub org and provide it with an alias (myhuborg in the command below):
sf org login web --set-default --alias myhuborg
-
Clone this repository:
git clone https://github.com/SalesforceLabs/ActionPlansV4 cd ActionPlansV4
-
From the terminal window, run the installation script
npm run scratchorg
or
. scripts/scratchorg.sh
-
That's it!
Follow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org. This includes non source-tracked orgs such as a free Developer Edition Org or a Trailhead Playground, or your own Sandbox.
Start from a brand-new environment to avoid conflicts with previous work you may have done.
-
Authorize your org and provide it with an alias (myorg in the command below):
sf org login web --set-default --alias myorg
-
Clone this repository:
git clone https://github.com/SalesforceLabs/ActionPlansV4 cd ActionPlansV4
-
If you are setting up a Developer Edition: go to Setup, and under My Domain, register a My Domain. Then ensure that enhanced domains are activated. You may need to enable Salesforce Edge network first.
-
To run all the next steps at once, run this command in the terminal:
. scripts/unmanaged.sh
The org will open. That's it!
Or run these steps one by one
-
Run this command to deploy the app.
sf deploy metadata --source-dir sfdx-source/LabsActionPlans
-
Assign the
Action_Plans_Admin
permission set to the admin user.sf org assign permset --name Action_Plans_Admin
-
(Optional) Load sample metadata (see below)
sf deploy metadata --source-dir sfdx-source/unmanaged
-
If your org isn't already open, open it now:
sf org open --target-org myorg
-
-
In App Launcher, select the Action Plans app.
This repository contains several files that are relevant if you want to add sample data, or integrate modern web development tooling to your Salesforce development processes or to your continuous integration/continuous deployment processes.
-
This repository creates sample data (Accounts, Contacts, Leads) if you choose to create a scratch org. To prevent this, go to the scratch org definition and change
hasSampleData
tofalse
."hasSampleData": false,
-
To create a sample Action Plan Template for Account onboarding, run the following:
sf apex run --file ./data/sample-data.apex
-
To create
- a sample Flow that uses the sample template
- a sample Account layout
- a sample Task layout
- a sample report on open Action Plan-related Tasks
sf deploy metadata --source-dir sfdx-source/unmanaged
-
You can also create other sample Account and Contact records by running the following command:
sf data import tree --plan ./data/action-plan-data-plan.json
-
When FIRST installing the package, it will automatically create a sample Action Plan Template for Account onboarding. If you want to recreate it manually, run the following:
sf apex run --file ./data/sample-data-managed.apex
-
To create
- a sample Flow that uses the sample template
- a sample Account layout
- a sample Task layout
- a sample report on open Action Plan-related Tasks
sf deploy metadata --source-dir sfdx-source/unmanagedExtension
-
You can also create other sample Account and Contact records by running the following command:
sf data import tree --plan ./data/action-plan-data-plan.json
Prettier is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .prettierignore and .prettierrc files are provided as part of this repository to control the behavior of the Prettier formatter.
Prettier Apex is an extension that handles Apex-specific formatting and allows the removal of the extra line via the Prettier config file. To use it with Visual Studio Code, follow these instructions from the Salesforce Extensions site.
This repository also comes with a package.json file that makes it easy to set up a pre-commit hook that enforces code formatting by running Prettier every time you git commit
changes.
To set up the formatting pre-commit hook:
- Install Node.js if you haven't already done so
- Run
npm install
in your project's root folder to install the Husky and Prettier modules (Note: Mac users should verify that Xcode command line tools are installed before running this command.)
Husky will now run Prettier automatically every time you commit changes, with some other updates if you installed the recommended extension ApexDox. You can also run the formatting from the command line using the following command (check out package.json for the full list):
npm run prettier