function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Replacing Referenced Fields (any easier ways?)

So I have decided that I need to encrypt some custom fields. Unfortunately I have already made them part of a managed released package. One of the fields I want to encrypt was set as an "External ID" so of course it can not be encrypted and therefore needs to be replaced with another field with a similar or same name but not external ID. Unfortunately from my limited experience this seems to take a LONG time, since you can't delete a referenced field.

So it seems that I have to:
1- Completely remove any references to this field from ALL apex classes (commenting out won't work)
2- Delete the old field entirely
3- Create a new field
4- Add code back into the classes to reference the new field.

Is there an easier way? If not, will I be OK if the new field also has the same field name?
If there is an easier way, I don't know about it.

Commenting out in Apex classes definitely works -- comments are not parsed unless I'm missing something. I've commented out fields for this several times.

One little time saver that may help speed that I use: I close all my Eclipse windows, then open all the classes that reference the field I'm changing. I delete or comment the references to the field, then save but keep all windows open. Then delete the field. Then I can just go back to Eclipse and "Ctrl-Z" undo all the deletions and save.

Having the same field name has not been a problem for any of the field changes I have done.

Jeremy Kraybill
Austin, TX