Can you convert a Master-Detail relationship to a Lookup if it’s referenced in code?

I’ve got a Master-Detail relationship on a custom object where the parent is the Account object. There are no roll-up summary fields on the Account object, and there are no formula fields on the custom object referencing the relationship.

For some reason I still don’t see the option to change the field back to a look-up relationship — there’s nothing in the documentation to suggest that I need to do anything with the data (unlike having null values when going the other way) so I’m wondering whether any code references to the field will stop the button from appearing or not.

I could dump the data in the field using DataLoader and try to delete it to find out, but I’m wondering if anybody knows what controls the Change Type buttons visibility?

Answer

Turns out I’d overlooked something: there was a deleted roll-up summary still in the deleted fields section of the Account object.

Deleting that allowed me to change the field’s type without modifying code and without deleting the field or losing data.

Attribution
Source : Link , Question Author : Matt Lacey , Answer Author : Matt Lacey

Leave a Comment