**Source URL:** https://limited.veevavault.dev/regulatory/vault-toolbox/intellij-plugin/getting-started/quickstart

# IntelliJ Plugin Quickstart

Learn how to set up the Vault Toolbox plugin for IntelliJ IDEA. This tutorial will then walk you through how to use Vault Toolbox to create and deploy a record trigger to Vault.

In this tutorial, you will learn how to:

*   Install the Vault Toolbox IntelliJ plugin
*   Create a new project
*   Authenticate to Vault
*   Use file and live templates to create a `RecordTrigger`
*   Deploy the `RecordTrigger` to Vault
*   Download the SDK Debug Log

## Prerequisites

To follow this tutorial, you need:

*   [IntelliJ IDEA v2024.3 or higher](https://www.jetbrains.com/idea/download) available from JetBrains downloaded and installed
*   A sandbox Vault with *Vault Owner* permissions, API access, and the *Product* (`product__v`) object
*   A [debug log session](https://platform.veevavault.help/en/lr/14341/#debug_log) enabled for your user account, with the *Log Level* scoped to *ALL* or *DEBUG*

## Installing Vault Toolbox

To install the Vault Toolbox plugin:

<Steps>
1.  Download the latest version of the [Vault Toolbox IntelliJ Plugin](https://plugins.jetbrains.com/plugin/31516-vault-toolbox) from the JetBrains Marketplace. Alternatively, you can install it from IntelliJ IDEA by navigating to **Settings > Plugins > Marketplace**, searching for "Vault Toolbox", and clicking **Install**.
2.  Launch IntelliJ IDEA.
3.  From the left sidebar, select **Plugins**.
4.  Click the gear (<Icon name="ph:gear" />) icon and select **Install Plugin from Disk…**
5.  Navigate to the Vault Toolbox IntelliJ Plugin `.jar` file downloaded and click **Open**.
6.  Under the *Installed* tab, verify that the new plugin, **Vault Toolbox**, is enabled. If not enabled by default, enable the plugin by selecting the checkbox.
</Steps>

 

<ThemeImage srcLight="/images/toolbox/intellij-plugin/install_plugin_light.png" srcDark="/images/toolbox/intellij-plugin/install_plugin_dark.png" alt="Installing the IntelliJ Plugin" />

 

<Aside>
Enabling the plugin allows the Vault Toolbox icon to appear in the right-hand sidebar. If the icon does not appear in the right-hand sidebar, navigate to **Tools > Enable Vault Toolbox**.
</Aside>

## Creating a New Project

Next, you will create a new project in IntelliJ IDEA from one of Vault Toolbox's [available generators](/regulatory/vault-toolbox/intellij-plugin/references/available-project-generators). Generators set up your project with the necessary configurations and dependencies. See the list of available generators for Vault Toolbox projects.

<ThemeImage srcLight="/images/toolbox/intellij-plugin/new_project_light.png" srcDark="/images/toolbox/intellij-plugin/new_project_dark.png" alt="IntelliJ Plugin Creating a New Project" />

To create a new project:

<Steps>
1.  Select **Projects** from the left sidebar, then select **New Project**.
2.  From the left sidebar of the dialog, underneath *Generators*, select **Vault Java SDK Hello World**.
3.  Populate the **Project name** with "sdk-hello-world" and confirm the **Project location**.
4.  Click **Create**.
</Steps>

Your Vault Java SDK Hello World project is now available with Vault Toolbox tools already configured.

<Aside>
Your project's Java SDK library version must match the Vault version, which can be retrieved by navigating to **Admin > About > Vault Information** in the Vault UI. To update the version in your IntelliJ project, open the POM (`pom.xml`) file in your project directory and update the `<vault.sdk.version>` attribute to match your Vault version. Learn more about [POM setup in the Vault Java SDK documentation](/vault-sdk/getting-started/development-setup/#Dev_Setup_POM).
</Aside>

## Authenticating to Vault

Prior to using Vault Toolbox's tools, you must authenticate to Vault.

To authenticate using basic login:

<Steps>
1.  In IntelliJ IDEA, open the Vault Toolbox plugin from the righthand sidebar.
2.  Select the **Vault Info** (<Icon name="ph:user" />) tab.
3.  For this Quickstart, select the **Basic** tab. See [Authenticating to Vault](/regulatory/vault-toolbox/intellij-plugin/guides/authentication) to learn more about the available authentication methods.
4.  Enter your **Vault DNS**, **Username**, and **Password**. Alternatively, click <Icon name="ph:caret-down" /> to load a saved credential.
    
    <ThemeImage srcLight="/images/toolbox/intellij-plugin/plugin_login_basic_light.png" srcDark="/images/toolbox/intellij-plugin/plugin_login_basic_dark.png" alt="IntelliJ Plugin Basic Login" />
    
5.  Click **Login**. At the bottom of the panel, Vault Toolbox prompts you to save these credentials.
6.  Optional: Click **Yes** to save these credentials. Provide a **Credential label** and click **Save**.
</Steps>

You've now successfully authenticated to Vault.

## Creating a Record Trigger

The following sections guide you through creating a `RecordTrigger` named `MyHelloWorld` from a file template, then customizing it with a live template.

The `MyHelloWorld` record trigger executes at the `BEFORE_INSERT` event on the `product__v` object. This means the trigger will execute custom code right before an object record is saved, and that this trigger only executes on `product__v` object records. When triggered, the custom code written for the `MyHelloWorld` trigger will send a `DEBUG` type message to your Vault's [Debug Log](/regulatory/vault-sdk/troubleshooting-runtime-errors/debug-log).

### Using File Templates

Vault Toolbox includes file templates for all Vault Platform SDK entry points that specify the default contents for new files you create within your project.

To create a `RecordTrigger` from a file template:

<Steps>
1.  Right-click the **src/main/java/com/veeva/vault/custom/triggers** folder within your *sdk-hello-world* project.
2.  Hover over **New**, and select the **Vault Java SDK RecordTrigger** file template.
    
    <ThemeImage srcLight="/images/toolbox/intellij-plugin/myrecordtrigger_light.png" srcDark="/images/toolbox/intellij-plugin/myrecordtrigger_dark.png" alt="IntelliJ Plugin MyHelloWorld Trigger" />
    
3.  In the dialog, populate the fields with the following values:
    1.  **Name**: MyHelloWorld
    2.  **Object**: product\_\_v
    3.  **Description**: A RecordTrigger for the Product object.
4.  Click **OK**.
</Steps>

Within the triggers folder, this action creates a file named `MyHelloWorldTrigger.java`. The new file includes the initial formatting necessary for a `RecordTrigger`, pre-populated with values from the fields prompted for previously. As shown in the screenshot below, if you provide `product__v` as the **Object**, the class is defined with `object = "product__v"`.

<ThemeImage srcLight="/images/toolbox/intellij-plugin/myhelloworldtrigger_light.png" srcDark="/images/toolbox/intellij-plugin/myhelloworldtrigger_dark.png" alt="IntelliJ Plugin MyHelloWorld Trigger" />

### Using Live Templates

Vault Toolbox includes live templates for creating snippets of [Vault Java SDK](/regulatory/vault-sdk/overview) code within an entry point.

To customize your `RecordTrigger` with live templates:

<Steps>
1.  Add the following import statements:
    
    ```
    import com.veeva.vault.sdk.api.core.LogService;
    import com.veeva.vault.sdk.api.core.ServiceLocator;
    ```
    
2.  Within the `MyHelloWorldTrigger.java` file, remove the auto-generated comments inside the `for` loop in the `execute()` method (lines 25-27).
3.  Next, we will replace this logic with our own custom logic using a live template. Inside the `for` loop in the `execute()` method, begin manually typing `sdk_debug_log` and select it in the dropdown that appears. A code snippet appears, utilizing the `LogService` interface to send a message to the Debug Log.
4.  Insert the text "Hello World" into the `debug()` method, as shown below.
    
    ```
    LogService logService = ServiceLocator.locate(LogService.class);
    logService.debug("Hello World");
    ```
    
5.  Save your `MyHelloWorldTrigger.java` file.
</Steps>

Next, you will deploy your `MyHelloWorld` trigger to your Vault.

## Deploying to Vault

To test your `MyHelloWorld` trigger, you must first deploy it to your Vault. While Vault Toolbox includes tools to assist with [designing, building, and deploying custom configuration migration packages](/regulatory/vault-toolbox/intellij-plugin/guides/designing-deploying-custom-vpks), this quickstart will utilize a user action to simplify the process.

To deploy your `MyHelloWorld` trigger to Vault, right-click on the `MyHelloWorldTrigger.java` file in your project directory and select **Veeva Vault > Deploy to Vault** (<Icon name="ph:upload" />). A dialog appears confirming a successful deployment. To verify that your record trigger has deployed, log in to the Vault UI and navigate to **Admin > Configuration > Record Triggers**. The VPK you deployed should be visible in the list with the name *com.veeva.vault.custom.triggers.MyHelloWorldTrigger* and a *Operational Status* of *Enabled*.

<ThemeImage srcLight="/images/toolbox/intellij-plugin/deploy_record_trigger_light.png" srcDark="/images/toolbox/intellij-plugin/deploy_record_trigger_dark.png" alt="Deploy the Record Trigger" />

## Downloading the Debug Log

The SDK Debug Log contains the execution details and Vault messages for custom Vault Java SDK code at the user level. The deployed `MyHelloWorld` record trigger executes right before a *Product* (`product__v`) object record is saved, sending the `DEBUG` type message, "Hello World", to your Vault's Debug Log.

A Vault Admin must already have configured a Debug log session for your user via the [Vault UI](https://platform.veevavault.help/en/lr/14341/#debug_log) or the Vault Toolbox plugin. To test your trigger, you must create a *Product* record in Vault and verify the result by downloading the debug log.

<Steps>
1.  After creating a *Product* record via the Vault UI, navigate back to IntelliJ IDEA.
2.  Within IntelliJ IDEA, open the Vault Toolbox plugin from the righthand sidebar.
3.  Select the **Actions** (<Icon name="ph:sliders-horizontal" />) tab.
4.  Expand **Developer Logs** (<Icon name="ph:brackets-curly" />) and double-click **SDK Debug** (<Icon name="ph:bug" />).
    
    <ThemeImage srcLight="/images/toolbox/intellij-plugin/sdk_debug_log_light.png" srcDark="/images/toolbox/intellij-plugin/sdk_debug_log_dark.png" alt="IntelliJ Plugin Download and Analyze SDK Debug Log" />
    
5.  In the dialog, select the debug log session for your user account. If the list is empty, a Vault Admin should [create a new debug log session](/vault-toolbox/intellij-plugin/guides/developer-logs/sdk-debug-logs#creating-sdk-debug-log-sessions) using the Vault Toolbox plugin.
6.  Click <Icon name="ph:download-simple" /> to download the selected log.
7.  In the dialog, previously downloaded logs are differentiated by a <Icon name="ph:eye" /> within the *View* column. To proceed with analyzing the debug log, select the checkbox for the downloaded log, then click <Icon name="ph:lightbulb" />. The CSV file of the analysis will then open in your preferred spreadsheet application.
</Steps>

 

<ThemeImage srcLight="/images/toolbox/intellij-plugin/download_sdk_debug_log_light.png" srcDark="/images/toolbox/intellij-plugin/download_sdk_debug_log_dark.png" alt="IntelliJ Plugin Downloaded SDK Debug Log" />

Once the operation is complete, you can access the downloaded SDK Debug Log `.zip` file from the `toolbox/logs/debug/{vaultid}` folder and the analysis files from `toolbox/logs/debug/{vaultid}/debug_analysis` in your project directory. Open the CSV, locate the row with a `type` of `DEBUG`, and verify that the `message` column reads `Hello World`.

<Aside>
If your `.zip` file is empty, it means there is no data in your Debug Log. Make sure your record trigger is deployed, and that you’ve created a *Product* record in your Vault to run the deployed trigger.
</Aside>

Congratulations! You've successfully set up the Vault Toolbox plugin for IntelliJ IDEA and used its functionality to create custom SDK code, deploy it to Vault, and download the Debug Log.

---

**Previous:** [Getting Started](/regulatory/vault-toolbox/intellij-plugin/getting-started)  
**Next:** [Guides](/regulatory/vault-toolbox/intellij-plugin/guides)