Wiki

Clone wiki

IlluminatedCloud / User_Guide / Removing_Metadata

[Home]

Removing Metadata

You can use Illuminated Cloud to remove metadata from your Salesforce organizations. This process is called metadata removal or metadata delete, and can be done explicitly or implicitly when you delete metadata from your local project.

Illuminated Cloud provides flexible mechanisms for choosing the subset of metadata you wish to remove from your connected orgs, the organization from which you wish to remove metadata, and how various options such as error reporting should be handled during metadata removal.

The available options for metadata removal also 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.

Illuminated Cloud supports selective bulk removal of metadata — allowing you to select the subset of metadata you want to act on. Can also monitor events performed against files in your local project, such as removals, and propagate those removals to the connected org.


Removing Metadata from Non-scratch Orgs

You can use the IDE to remove a set of metadata files in bulk in a single request. You can access the Delete Metadata command from the Tools > Illuminated Cloud menu, Illuminated Cloud context menu, the toolbar, or using the respective keyboard shortcuts.

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

Removal-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 removal-specific options:

delete_scope.png

Use the following options to specify how you want the IDE to behave:

Ignore Errors — If checked, any errors encountered will not cause the delete to fail and roll back.

Ignore Warnings — If checked, any warnings encountered will not cause the delete to fail and roll back.

Both of these options permit a partial delete where items that can be deleted will be, and any items that can’t be deleted will be reported as error or warnings that you can resolve and delete afterwards. If you want the IDE to treat the delete operation as a single transaction that can be rolled back, uncheck both of these options.

Purge on Delete — If checked, deleted metadata bypasses the recycle bin and is completely removed from the organization. WARNING: Purged metadata cannot be restored, so use this option with caution.

Removing Metadata Explicitly

To select the exact subset of metadata which will be removed from the organization, select Delete Metadata delete_icon.png.

The Select Delete Scope dialog defaults to current project’s connection. Select another from the Connection drop-down if desired.

Use the Contents drop-down to select the broad subset of metadata you want to delete. We recommend you use the current Context or a Custom selection to narrow the scope of content to act on, reserving Module or *Project for occasions when you want to clean up a target org.

delete_scope2.png

TIP: To find orphaned metadata and focus the scope of the removal operation on that specific subset of metadata, select Custom for Contents and check only the Server Only and Subscribed by Parent option to identify metadata that's not part of your subscription. We recommend you use this approach when your project is considered the authoritative source for this metadata and you want to maintain a clean version of the metadata being used in the target org.

After you have specified the organization from which you wish to delete metadata and the exact subset of metadata you wish to remove from that organization, click Delete.

Illuminated Cloud notifies you when the delete operation completes.

delete_status.png

When the operation is complete, details about the deleted metadata — including any errors encountered during removal — are displayed in the Messages window.

NOTE: If you try to delete metadata that cannot be deleted from the server — because, for example, a field is being referenced by a class on the server — the delete operation will fail and generate an error. Click Messages below to view the details. To resolve this type of error, you’ll need to remove the referencing class first or, alternatively, include the referencing class in the delete operation alongside the field so that both components are deleted in the same transaction.

Removing Metadata Implicitly

When deleting metadata from your local project, you can optionally remove the metadata from the connected org.

For example, if you delete an Apex class, you’ll be prompted as follows:

delete_local.png

RECOMMENDED: Check Safe delete (with usage search). When you click OK, the IDE will search for any usages of the item being deleted and notify you if it finds any.

Illuminated Cloud prompts you to choose whether you want to delete it from the connected organization as well.

connection_delete_prompt.png

You’re also prompted to update your metadata subscription with the change, to help you keep your projects and connections in sync.

metadata_update_prompt.png

If you click Yes, Illuminated Cloud updates your metadata subscription and notifies you:

subscription_updated.png

The IDE then performs a delete operation. If it encounters any errors in the process, you can select Edit > Undo to immediately undo the delete operation and restore the local file.


Removing Metadata from 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. Scratch org delete operations are therefore impacted by the options you've configured for interacting with the Salesforce CLI.

If you’ve selected the Allow deploy/retrieve/delete operations against scratch orgs option on the Salesforce DX tab you can follow the process for explicitly deleting metadata from non-scratch orgs that's described above, as it's the same for scratch org projects.

NOTE: After explicitly deleting items from a local scratch org, you'll need to use the Pull Metadata pull_down_icon.png command to update the SourceSync API with your changes, so they can be properly propagated to your org.

Otherwise, the SourceSync API will reconcile the differences the next time you perform a Push operation. In this case, Undo is no longer an option, so you’ll need to Retrieve metadata from the scratch org to get that field back to a good state.

[Home]

Updated