[SalesForce] Convert Custom field type from text to lookup/master-detail in salesforce

I have created custom field with Text data type..For some reason I need to change the field type to a look-up/master-detail relationship.

But when i click on "Change Field Type" button for that custom field, It's not showing lookup/master-detail relationship option.There is no records available in that object.

Can any one guide me how can i change that custom field type to lookup/master-detail.

Thanks,

Best Answer

You cannot do that, the only option you have is create an extra field, and afterwards process your lookup with a Execute Anonymous script or something.

The fact is that in your database, in the column of your Lookup Field, there isn't a Name stored for the record where the lookup refers to. In the lookup column you'll find an Id, that takes the Id of the object that the lookup refers to. There is no way salesforce knows how to convert a Text column to an Id Column, and that is why you cannot change form text to lookup.