Skip to content

Latest commit

 

History

History
182 lines (125 loc) · 8.03 KB

INSTALLATION.md

File metadata and controls

182 lines (125 loc) · 8.03 KB

Action Plans Installation

Follow these instructions to deploy Action Plans to your org.

Deployment Methods

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


AppExchange (Managed Package - RECOMMENDED)

Action Plans: This is the best way to install the package, which you can easily upgrade as features are added.

Installing the App using a Scratch Org

  1. 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
  2. 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
  3. Clone this repository:

    git clone https://github.com/SalesforceLabs/ActionPlansV4
    cd ActionPlansV4
  4. From the terminal window, run the installation script

    npm run scratchorg

    or

    . scripts/scratchorg.sh
  5. That's it!

Installing the App using a Developer Edition Org or your own Sandbox Org

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.

  1. Authorize your org and provide it with an alias (myorg in the command below):

    sf org login web --set-default --alias myorg
  2. Clone this repository:

    git clone https://github.com/SalesforceLabs/ActionPlansV4
    cd ActionPlansV4
  3. 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.

  4. 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

    1. Run this command to deploy the app.

      sf deploy metadata --source-dir sfdx-source/LabsActionPlans
    2. Assign the Action_Plans_Admin permission set to the admin user.

      sf org assign permset --name Action_Plans_Admin
    3. (Optional) Load sample metadata (see below)

      sf deploy metadata --source-dir sfdx-source/unmanaged
    4. If your org isn't already open, open it now:

      sf org open --target-org myorg
  5. In App Launcher, select the Action Plans app.

Optional Installation Instructions

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.

Data/Metadata Import (Optional - NOT available if using the AppExchange managed package)

  • 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 to false.

    "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

Data/Metadata Import (Optional - ONLY if using the AppExchange managed package)

  • 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 

Code formatting

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.

Pre-commit hook

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:

  1. Install Node.js if you haven't already done so
  2. 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