Wiki

Clone wiki

IlluminatedCloud / User_Guide / Deploying_Metadata

[Home]

Deploying Metadata

Illuminated Cloud can update your Salesforce organizations with your project's local metadata files. This process is called metadata deployment.

Illuminated Cloud provides flexible mechanisms for choosing the subset of metadata you wish to deploy, the organization against which you wish to deploy, and how various options such as conflict detection, unit test execution, and error reporting should be handled during deployment.

The available options for metadata deployment vary based on whether you're working against non-scratch orgs such as Developer Edition orgs, Sandboxes, or Productions orgs, or whether you're working against Salesforce DX scratch orgs.

There are several ways you can deploy the metadata that’s in your local Illuminated Cloud project to the associated Salesforce organization:

  • Configure the IDE to auto-deploy your changes to the server whenever you save them locally.

  • Determine the subset of metadata that has changed, or choose a specific subset of metadata, and deploy only those updates. This happens automatically when deploying/pushing metadata to scratch orgs.

  • Deploy all metadata, without first determining differences. This option is not available when deploying/pushing metadata to scratch orgs using the Salesforce DX push operation.

Illuminated Cloud always tries to use the most efficient deployment mechanism possible based on the selected metadata and the available APIs. The Tooling API tends to be faster than the Metadata API for deploying supported metadata. The Tooling API can be used to deploy any combination of Apex classes/triggers and Visualforce pages/components, any single Aura bundle file, or any single static resource unless you’ve disabled these configuration options in the Prefer Tooling API for section of the Validation and Deployment tab. The Metadata API is used to deploy any other combination of metadata types.

Deploying on Save

If you've configured the IDE to automatically deploy on save, whenever you make and save a local change the status bar will indicate that Illuminated Cloud is deploying your change to the server. For a more detailed explanation of any operation the IDE performs, simply click Messages.

If there are errors in your code that can be resolved to local metadata files, Illuminated Cloud detects them and displays them. They're also listed on the Problems tab of the Illuminated Cloud window, so you can easily locate and resolve them.

NOTE: All deployment errors are included in the Messages view even if they cannot be resolved to local metadata files.


Deploying Against Non-scratch Orgs

You can use the IDE to deploy a set of metadata files in bulk, in a single request. You can access the Deploy Modified Metadata and Deploy All Metadata commands from the Tools > Illuminated Cloud menu, Illuminated Cloud context menu, the toolbar (in most cases a toolbar icon is available), or using the respective keyboard shortcuts.

NOTE: Select View > Toolbar to enable the toolbar, if it isn't visible.

Deployment-specific Options

After you've familiarized yourself with the options available to specify the scope for all bulk metadata operations, it's important that you also understand the deployment-specific options:

deployment_options.png

  • Ignore Errors — If checked, errors won’t cause the deployment to fail and roll back and all metadata which can be deployed will succeed. If unchecked, the deployment will be processed as a single transaction and any error will cause the entire deployment to roll back.

  • Ignore Warnings — If checked, warnings won’t cause the deployment to fail and roll back and all metadata which can be deployed will succeed. If unchecked, the deployment will be processed as a single transaction and any warning will cause the entire deployment to roll back.

  • Check Only — If checked, a check-only deployment will be performed to validate the metadata selected for deployment without committing it to the organization.

  • Test Level — Allows selection of the level of Apex unit testing to be performed during the deployment:

    • <Default> — Select this option to use the default test level of the target organization based on what you selected for deployment (e.g., No Test Run for development orgs; Run Local Tests Apex when Apex source is being deployed to a Production org).

    • No Test Run — Select this option to perform no testing. If this isn’t allowed based on the metadata you’re trying to deploy or the org you want to deploying to, the deployment request will result in an error message.

    • Run Specified Tests — Select this option then choose the specific unit test configuration to run. Click to choose or add a specific unit test configuration denoting the subset of unit tests you want to run.

    • Run Local Tests — Select this option to run all unit tests for which the source code is available locally in the organization (vs. from an installed managed package).

    • Run All Tests in Org — Select this option to all run tests for which source code is available locally in the organization and from all installed managed packages. Running all tests can be expensive but can help ensure that your metadata isn't introducing any incompatibilities with installed managed packages.

TIP: Remember that all deployment operations are impacted by the Require confirmation for all write operations and Check for conflicts on deployment options you've configured for the connection.

Deploying Modified Metadata

To deploy only those metadata items that have been updated or added locally since the last successful deployment operation (and are therefore out-of-date with what's on the server), select Deploy Modified Metadata deploy_modified_icon.png.

Illuminated Cloud compares the last modified timestamps of the selected subset of metadata against the last modified timestamps of the same metadata on the server and deploy only those metadata items that have been created or modified more recently locally.

NOTE: For performance reasons, out-of-date calculations are performed only after you click the Deploy button. At that point, the exact subset of metadata that is considered out-of-date will be deployed.

The Deployment Complete message that’s displayed indicates how many components were deployed to the organization, how long the deployment operation took to complete, and the status of the operation:

deployment_status_1.png

deployment_status.png

If no changes are detected and all metadata is up-to-date, nothing is deployed and Illuminated Cloud displays a message stating that "All files are up-to-date”.

deployment_status.png

Deploying All Metadata

To deploy all selected metadata items without first determining which subset is out-of-date, select Deploy All Metadata deploy_all_icon.png.

This is useful on occasions when Illuminated Cloud can’t determine the relationship between metadata on the server and what you have locally, or when Salesforce won’t allow metadata components to be deployed separately.

Deploying Specific Metadata

When you select Deploy Modified Metadata or Deploy All Metadata, the metadata that’s deployed is always based on your current selection (context, module, project). To select a specific subset of metadata to deploy, you can select Custom. For more information, see Specifying the Scope for Bulk Metadata Operations.

TIP: To save only those changes to the files you are working on, select the Force Save command. (This is equivalent to enabling the Deploy on save option and using the Save All action on the same files).


Deploying Against Scratch Orgs

When working with scratch orgs, the Salesforce CLI is responsible for reconciling local metadata with scratch org metadata via its Push and Pull operations.

In Illuminated Cloud scratch org projects, you'll use the Push Metadata push_up_icon.png and Pull Metadata pull_down_icon.png commands to deploy metadata to and retrieve metadata from scratch orgs. This terminology is also reflected in the bottom status bar and Problems view to indicate when the IDE is “Pushing…” a change, and in "Push Complete" messages.

TIP: Remember that scratch org push operations are impacted by the options you've configured for interacting with the Salesforce CLI.

When you need more fine-grained control over the metadata you want to push to your scratch org, you can use the Deploy Modified Metadata and Deploy All Metadata commands described above. For more information, see Specifying the Scope for Bulk Metadata Operations.

[Home]

Updated