3

In our ISV package we had to "convert" a pre-indexed Lookup field to a Text(255) field as we wanted to keep Ids even when the referenced record was deleted.

After we did that the performance of SOQL queries which filter on this field dramatically decreased. Some batches aborted as the query was doing a full-table scan.

I know Salesforce Support will on request add a filter on this field for specific customer orgs. But I am looking into a way to solve this for all orgs of our managed package.

  1. Is there a way to make an existing field an external Id afterwards?
  2. Have you been successful asking Support for doing this?
  3. What was their response?

EDIT: I have found this idea which looks like this is not at all possible, but I don't understand why Salesforce should prevent ISVs from adding an index afterwards. This doesn't seem to corrupt exiting data, does it? 4. Is there any downside to use External Ids instead of Custom Indexes by Salesforce regarding performance and selectivity?

1
  • 1
    One thing I remember is that an External ID doesn't index null values, whereas a Custom Index does. Depending on your data, this may or may not be a consideration.
    – Doug B
    Jul 22 '13 at 8:22
4

CORRECTIONS

The above solution did not work as you cannot convert a Managed package back to Beta if it was already released.

And the version where we added the relevant field was released years before I contacted support.

So no, the only thing you can do is either deprecated and remove the old field from the package and migrate it to a new packaged external field or add an index to the existing field for every single customer org.

1

Got back an answer from Support. It indeed is possible by first making your package a Beta again.

As the field is the part of the managed package and is in the Managed - Released Version, and we can not modify any components in Managed - Released, first we need to convert the package to Managed - Beta and then we can make the field as External ID and then, we can upload the package to Managed - Released. Once it is done, you can release as a patch to your customers.

enter image description here

2
  • did it worked? I am having a managed package and turned it in Beta. but the text field external id is still read only. I can not comment so adding this as answer. Mar 26 '14 at 12:19
  • No, it did not work as you cannot convert a Managed package back to Beta if it was already released. And the version where we added the relevant field was released years before I contacted support. So no, the only thing you can do is either deprecated and remove the old field from the package and migrate it to a new packaged external field or add an index to the existing field for every single customer org. Jan 21 '15 at 11:14

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.