Skip to content

Sample application that showcases Data Cloud, Agents and Prompt Builder.

License

Notifications You must be signed in to change notification settings

trailheadapps/coral-cloud

Coral Cloud Resorts

CI

App logo

Welcome to Coral Cloud Resorts, a sample hospitality application. Coral Cloud Resorts is a fictional resort that uses data and AI to deliver highly personalized guest experiences. It presents different ways and benefits of bringing generative AI into business workflows, including new smart automation capabilities, content generation, and summarization.

The Coral Cloud Resorts app showcases Data Cloud, Agents and Prompts.

Table of contents

Installation

Requirements

Environment

The Coral Cloud Resorts app requires licenses for the following features:

  • Data Cloud
  • Agents (formerly known as Einstein Copilot)
  • Prompt Builder field generation templates
  • Einstein for Sales (for Prompt Builder sales emails)
Trailhead Badge Obtain an Org with these features and learn more about the app with the Quick Start: Explore the Coral Cloud Sample App Trailhead badge.

Important

Start from a brand-new environment to avoid conflicts with previous work you may have done.

Salesforce CLI

Install the Salesforce CLI or check that your installed CLI version is greater than 2.56.7 by running sf -v in a terminal.

If you need to update the Salesforce CLI, either run sf update or npm install --global @salesforce/cli depending on how you installed the CLI.

Step 1. Feature activation

  1. Make sure that Data Cloud provisioning is complete before moving forward.

    To check this, go to Data Cloud Setup. The page should look like this if provisioning is complete. If you see a Get Started button, click it and wait for the process to complete. This can take up to ten minutes.

Data Cloud Setup screenshot showing that povisioning is complete

  1. From Setup, go to Einstein Setup and click Turn on Einstein.

  2. From Setup, go to Agents and toggle on Einstein Copilot for Salesforce. You may need to refresh the page to see the Agents menu after turning on Einstein.

  3. From Setup, go to Einstein for Sales and ensure that Turn on Sales Emails is toggled on.

Step 2. Base metadata deployment

  1. Clone this repository:

    git clone https://github.com/trailheadapps/coral-cloud
    cd coral-cloud
  2. Authorize your org with the Salesforce CLI, set it as the default org for this project and save an alias (coral-cloud in the command below).

    sf org login web -s -a coral-cloud
  3. Deploy the app metadata.

    sf project deploy start
  4. Assign the Coral Cloud permission set to the default user.

    sf org assign permset -n Coral_Cloud
  5. Import some sample data.

    sf data tree import -p ./data/data-plan.json
  6. Generate additional sample data with this anonymous Apex script.

    sf apex run -f apex-scripts/setup.apex
  7. Install a Data Kit to add Data Cloud components to your org.

    sf package install -p 04tHr000000ku0X -w 10
  8. If your org isn't already open, open it now:

    sf org open

Troubleshooting

Salesforce CLI data plan import fails with STORAGE_LIMIT_EXCEEDED

This may happen if you already have data in the org or if a previous data plan import failed and some records were saved. To fix it, clear existing record by running the following CLI command in a terminal:

sf apex run -f apex-scripts/wipe-data.apex

Optional Installation Instructions

This repository contains several files that are relevant if you want to integrate modern web development tools into your Salesforce development processes or into your continuous integration/continuous deployment processes.

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.

Important

The current Apex Prettier plugin version requires that you install Java 11 or above.

Code linting

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.

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 and linting by running Prettier and ESLint every time you git commit changes.

To set up the formatting and linting 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 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