Metadata Deployments do not correctly prevent the removal of LookupFilters on managed-released Custom Fields
Last updated 2014-12-23 ·Reference W-2257558 ·Reported By 5 users
Metadata Deployments do not correctly prevent the removal of LookupFilters on managed-released Custom Fields.
It is possible using Eclipse/ANT to remove lookup filters on managed released components, which then causes an error on package upgrades.
The package upgrade process tries to delete the lookup filter but cannot.
The expected behaviour should be the same as when using the UI, i.e. the deletion should be blocked.
1. In a clean DE org, add a custom lookup field on Contact related to Account
2. Define a Lookup Filter for the field (e.g. Account:IsActive = true)
3. Upload a managed released package that contains the field.
4. Through the UI, try to edit the field and remove the lookup filter (note the message 'Cannot Delete Managed Component' which is expected).
5. Now try an ant deployment which contains the Contact.object metadata with the <lookupFilter/> removed.
6. Note that you can successfully remove the filter via the ant deployment.
7. The impact here is that there is an 'Orphaned' LookupFilter in the org.
If you attempt to add the lookup filter back in by editing the custom field through the UI, you will get a Unique Constraint Violation.
The implications are also seen by customers upgrading to a new version of the package with the filter removed:
- During package upgrade if we detect deleted components we delete them from the org.
- The problem here is that lookup filters are not supported by managed component deletion, so we get error.
As a workaround, contact Salesforce Support/R&D so that we can resolve the issue for you.
After that, you will be able to edit the Custom Lookup Field from the UI and add the LookupFilter back in.
You will then need to upload a new released version of the package to be installed by your customers.
Partners should be advised that until this issue is resolved, they should be careful when deploying components via ant or Force.com IDE, to ensure they do not remove any existing lookup filters from their lookup fields.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.