Skip to content

mdapi-issues/deploy-deleted-flow

Repository files navigation

deploy-deleted-flow

Deploying a Flow as a Destructive Change does not work out of the box (insufficient access rights on cross-reference id) but there is a workaround.

Actions Status

Important

A green status badge means the issue was successfully reproduced.

A red status badge means the issue was fixed or the pipeline failed for another reason.

Issue

When trying to delete a Flow with a destructiveChanges.xml or destructiveChangesPost.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Set_Account_Description</members>
        <name>Flow</name>
    </types>
</Package>

You'll get this error message:

insufficient access rights on cross-reference id

Known Issue: https://issues.salesforce.com/issue/a028c00000gAwixAAC/deletion-of-flow-metadata-through-destructive-changes-not-supported

Workaround

It is possible to deactivate the Flow and delete all inactive Flow Versions in a single deployment:

Deactivate a Flow: Deploy a FlowDefinition (flowDefinitions/Set_Account_Description.flowDefinition-meta.xml) with active version number 0:

<?xml version="1.0" encoding="UTF-8"?>
<FlowDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
    <activeVersionNumber>0</activeVersionNumber>
</FlowDefinition>

Delete inactive Flow Versions using destructiveChangesPost.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Set_Account_Description-1</members>
        <members>Set_Account_Description-2</members>
        <name>Flow</name>
    </types>
</Package>

References

Bug reports and forums

Open Source Tools

Vendors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages