2

We need to make couple of existing external Id fields unique in a managed package, But it's not possible to make them unique once released.

Unfortunately these have been not made unique by mistake (and Values are maintained unique).

My approach is create a new another external Id unique field and run a post install script to update the new field from the old field and change App's code to use new field.

Is there a better approach or suggestion I can workout to solve this?

Any idea if we can get this done by raising a support case, didn't bother this avenue since doc clearly says it's not editable once released.

Appreciate any help on this. Thanks.

  • 2
    You may as well submit a case; just because the docs say something doesn't mean it is actually impossible. I've seen them do some pretty "impossible" things. Note: make sure you're going through partner support, not technical support. – sfdcfox Jan 19 '18 at 1:51
  • Thanks @sfdcfox will try that, and update if I get a favorable response. – Pasan Eeriyagama Jan 19 '18 at 2:49
1

Below is quoted from Salesforce support reply.

As per checking, if you are trying to modify a field added to a managed package, then you may need us to revert the package to beta in order to unlock the component. We can revert a Managed package version to beta, and then you would be able to modify / remove any obsolete items.

But, please note that a revert to Beta can only be done if the package is not active in any organization. If the package is found to be active, then you must take action to have the package uninstalled from any subscriber org. Also, package would need to go through the security review again (review fee also applies); once changes are made a new version is released.

Note that if there are package versions higher than the version you want to revert , then you would have to revert the higher versions first. Also, if the component you wish to edit or remove was first included in version 1.0 and you are currently at higher released version 5.0 , in order to edit the component you will have to revert package versions all the way down to version 1.0.

Once the package has been reverted back to beta, you may refer to the link below about Changin Data Type for Custom Fields:

https://help.salesforce.com/apex/HTViewHelpDoc?id=notes_on_changing_custom_field_types.htm&language=en_US

If you wish to proces with this request, please confirm the following so we can escalate this to the higher level for approval:

  • Please provide the Org ID:

  • The person requesting for this feature activation is the System Administrator of this Salesforce instance.

  • Package version you want to revert to beta:

  • I understand that all subsequent versions will be also forced to beta;

  • I confirm that there is no patch org created for the package version;

  • That the package is not installed in any orgs

  • That you are aware the new version will go through security review (only for Aloha-approved / AppExchange packages)

  • That you may need to pay the review fee (only for Aloha-approved / AppExchange packages)

Please reply with these necessary information for us to be able to proceed for the activation process.

I think above is possible for a recently added/released field.

Therefore as a workaround, did below.

  1. Created new Unique External Id field
  2. Added a batch job to Post install script to update the new field from old field values
  3. Modified the places in Apex, etc. where the field has been used (used Eclipse to find and replace source)
  4. Added Release notes a section with Technical details to refer (to configure Data loader script mapping if any customers have been using the field)

Hope this could help someone else having the same issue. Please feel free to share any other ideas on this.

Thanks.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.