# Workflow for Tableau Next Scratch Orgs

Get started with Tableau Next development using your Dev Hub to create scratch orgs with Data 360 and Tableau Next enabled. Use your scratch org to create and publish Tableau Next assets, such as dashboard extensions.

## Supported editions

Tableau Next requires Dev Hub to be enabled in Developer, Enterprise, Performance, or Unlimited Editions. Scratch orgs are supported in Developer, Enterprise, Group, and Professional Editions.

## Before you begin

Complete these prerequisites before creating or working on a Tableau Next templated app or assets.

- **Get an Org for Dev Hub**
  - Developers: Use [Sign up for a Developer Edition org](https://developer.salesforce.com/signup) to get a Developer Edition org to use as your Dev Hub org.
  - Partners: Use your Partner Business Org (PBO) as your Dev Hub org. If you don’t yet have a PBO, follow the steps in [Join the Salesforce Partner Community](https://partners.salesforce.com/pdx/s/signup?language=en_US) and [Request a Salesforce Partner Business Org](https://developer.salesforce.com/docs/platform/isvforce/guide/appexchange-partner-request-pbo.md).

- **Enable Dev Hub**
  Enable Dev Hub in your Developer Edition org or PBO. See [Select and Enable a Dev Hub](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm).

- **Enable Data 360 and Tableau Next for Scratch Orgs**
  Data 360 scratch org support is only available when the Dev Hub is part of your Partner Business Org (PBO). To use Data 360 and Tableau Next in scratch orgs, Salesforce partners must log a case in the Salesforce Partner Community. Use the case to request that your PBO Dev Hub org be granted permission to create Data 360 scratch orgs. This request is only granted to PBO orgs.

- **Enable Second-Generation Managed Packaging**
  Enable second-generation managed packaging (2GP) in your Dev Hub org. See [Enable Dev Hub and Second-Generation Managed Packaging](https://developer.salesforce.com/docs/atlas.en-us.pkg2\_dev.meta/pkg2\_dev/sfdx_pkg_enable_devhub.htm).

- **Sign Up for a Namespace Org**
  If you already have a registered namespace, skip this step. Otherwise, create a separate Developer Edition org to serve as your namespace org, and specify your desired namespace. See [Create and Register Your Namespace for Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2\_dev.meta/pkg2\_dev/sfdx_dev_dev2gp_create_namespace.htm).

- **Register the Namespace**
  From your Dev Hub org, register the namespace created in the previous step. See [Link a Namespace to a Dev Hub Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_reg_namespace.htm).

- **Install Development Tools**
  - Install VS Code. See [Install Salesforce Extensions in Visual Studio Code](https://developer.salesforce.com/tools/vscode/en/vscode-desktop/install#visual-studio-code).
  - Install the Salesforce CLI. See [Install Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm).
  - Install the Salesforce Extension Pack (Expanded) for VS Code. See [Salesforce Extension Pack (Expanded)](https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-expanded).

## Create a Salesforce DX project

- Create a project. See [Create a Salesforce DX Project](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_create_new.htm).

- Configure the `sfdx-project.json` file.
  - Specify your package's namespace with the `namespace` attribute. For example: `"namespace":"exp-mgr"`.
  - Specify the login URL for production, which is `https://login.salesforce.com`.

## Create a scratch org

To work with Data 360 and Tableau Next features in a scratch org, you must first set up a scratch definition file and use the Salesforce CLI to create the scratch org.

- To create a scratch org, from the CLI, use:

  ```bash
  sf org create scratch -a SCRATCH_ORG_NAME -f config/project-scratch-def.json -w 10 -v DEVHUB_ALIAS`
  ```

  The next example shows a sample scratch definition file. See [Create Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_create.htm). This scratch org is the publisher or source org where you create the Data 360 and Tableau Next elements and add them to a data kit.

  The following is a sample `project-scratch-def.json` file with Data 360 and Tableau Next licenses.

  ```json
  {
    "orgName": "Salesforce",
    "edition": "Developer",
    "features": ["EnableSetPasswordInApi", "CustomerDataPlatform", "CustomerDataPlatformLite", "TableauEinstein"],
    "settings": {
      "lightningExperienceSettings": {
        "enableS1DesktopEnabled": true
      },
      "customerDataPlatformSettings": {
        "enableCustomerDataPlatform": true
      }
    }
  }
  ```

- To open the scratch org, run the `sf org open` command. Navigate to Data Cloud Setup to verify that Data 360 is enabled. If you see green checkmarks, then Data 360 is provisioned.

## Enable Tableau Next

- From Salesforce Setup, in the Quick Find box, enter *Tableau Next*, and then select **Tableau Next Setup**.
- Enable Tableau Next.

To work with data kits, see [Workflow for Creating Data 360 Data Kits with Tableau Next Assets](/docs/analytics/tableau-next-isv-dev/guide/tn-data-360-data-kit-workflow.md).

To package your Tableau Next app, see [Package Your Tableau Next App](/docs/analytics/tableau-next-isv-dev/guide/tn-package-your-app.md).

## See Also

- Second-Generation Managed Packaging Developer Guide: [Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2\_dev.meta/pkg2\_dev/sfdx_dev_dev2gp.htm)
- Data Cloud Developer Guide: [Packages and Data Kits](https://developer.salesforce.com/docs/platform/data-cloud-dev/guide/packages-data-kits.md)
