This is a fork of the Dreamhouse sample application created by Salesforce developer relations team. This fork has been customized for the purpose of the Audicity setup and configuration tutorial where you can practice installing and running the Audicity data and transaction tracking app.
Audicity and this project run in the Salesforce platform. In order to run it, and work with Audicity, you need a working Salesforce environment (also known as an "org" if you're new to working with Salesforce). Some steps below make use of Salesforce's expansive resources to get up and running with an environment. We are not Salesforce and cannot control Salesforce's enablement resources. If they change, and no longer work, please file an issue in this repo and let us know. We'll work as quickly as we can to provide an alternative resource.
-
Installing Dreamhouse Using a Scratch Org: This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
-
Installing Dreamhouse using a Developer Edition Org or a Trailhead Playground: Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.
-
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 Developer Edition org
- Install Salesforce CLI
- Install Visual Studio Code
- Install the Visual Studio Code Salesforce extensions, including the Lightning Web Components extension
-
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 -d -a myhuborg
-
Clone this repository:
git clone https://github.com/processity/dreamhouse-audicity.git cd dreamhouse-audicity
-
Create a scratch org and provide it with an alias (dreamhouse-audicity in the command below):
sf org create scratch -d -f config/project-scratch-def.json -a dreamhouse-audicity
-
Push the app to your scratch org:
sf project deploy start
-
Assign the dreamhouse permission set to the default user:
sf org assign permset -n dreamhouse
-
Import sample data:
sf data tree import -p data/sample-data-plan.json
-
Open the scratch org:
sf org open
-
In App Launcher, select the Dreamhouse app.
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. While there is no reason to use a Trailhead Playground, it is an option, if you insist on giving it a try.
Make sure to start from a brand-new environment to avoid conflicts with previous work you may have done.
-
Clone this repository:
git clone https://github.com/processity/dreamhouse-audicity.git cd dreamhouse-audicity
-
Authorize your Trailhead Playground or Developer org and provide it with an alias (dreamhouse-audicity-devorg in the command below). Note this command launches a browser window and you must successfully login to the org to complete the process. If you do not complete the login successfully, the subsequent commands will not function:
sf org login web -s -a dreamhouse-audicity-devorg
-
Run this command in a terminal to deploy the app.
sf project deploy start -d force-app
-
Assign the
dreamhouse
permission set to the default user.sf org assign permset -n dreamhouse
-
Import some sample data.
sf data tree import -p ./data/sample-data-plan.json
-
If your org isn't already open, open it now:
sf org open -o dreamhouse-audicity-devorg
-
In App Launcher, select the Dreamhouse app.
Properties inserted using the Salesforce CLI will appear as listed on TODAY() - 10 days.
None of these are necessary in order to run Audicity. These are kept in place here solely to honor the intent of the original creators of the Dreamhouse app.
This repository contains several files that are relevant if you want to integrate modern web development tooling to your Salesforce development processes, or to your continuous integration/continuous deployment processes.
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.
Warning The current Apex Prettier plugin version requires that you install Java 11 or above.
ESLint is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. To use ESLint with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .eslintignore file is provided as part of this repository to exclude specific files from the linting process in the context of Lightning Web Components development.
This repository also comes with a package.json file that makes it easy to set up a pre-commit hook that enforces code formatting and linting by running Prettier and ESLint every time you git commit
changes.
To set up the formatting and linting 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 ESLint and Prettier modules (Note: Mac users should verify that Xcode command line tools are installed before running this command.)
Prettier and ESLint will now run automatically every time you commit changes. The commit will fail if linting errors are detected. You can also run the formatting and linting from the command line using the following commands (check out package.json for the full list):
npm run lint
npm run prettier
The app GeocodingService uses OpenStreetMap API to geocode property addresses. OpenStreetMap® is open data, licensed under the Open Data Commons Open Database License (ODbL) by the OpenStreetMap Foundation (OSMF). You are free to copy, distribute, transmit and adapt OpenStreetMap data, as long as you credit OpenStreetMap and its contributors. If you alter or build upon our data, you may distribute the result only under the same licence. The full legal code explains your rights and responsibilities in regard to the service.
(For the moment, this is more of a todo list for the project. Eventually this should become a list of the project artifacts and links that were added for Audicity.)
- Installation instructions for Audicity package on AppExchange (generate org password and then login to org during appexchange install)
- Assigning Audicity Permset
> sf org assign permset -n AudicityLoggingAdministrator
- turn on audicity tracking
- configure Property object and some fields for tracking
- make sure to save object settings even when changing fields
- add the Audit Trail LWC to the property record page with Lightning app builder
- instrument the
PropertyTrigger
trigger withmantra.AudicityApex.track()
- test creating and editing a Property record
- add the trigger for campaign and instrument it with
mantra.AudicityApex.track()
- (maybe test again here)
- instrument the
jobId
in the trigger handler andexecute()
method of each Queueable - test an update action again