You need to sign in to do that
Don't have an account?
Vance Kessler
Change from single field to a Lookup without loosing existing values
The business has decided to change what used to require a reference to a single text value to now require a list of text values. We currently hold the value in a single field but will need to create a new table with a master/detail relationship to hold the list of values moving forward.
My question is how do I change the field type and create this table withoug loosing the existing data? I know I can create the table and a new field before I get rid of the existing field, but I am not sure how to get the data into the new table.
This would be a trivial INSERT INTO statement in SQL but I am stumped how to do this in SF. I looked all over for general advice on schema changes and migrating existing data but found nothing. This CANNOT be a new concept to SF.
Thanks,
Vance
My question is how do I change the field type and create this table withoug loosing the existing data? I know I can create the table and a new field before I get rid of the existing field, but I am not sure how to get the data into the new table.
This would be a trivial INSERT INTO statement in SQL but I am stumped how to do this in SF. I looked all over for general advice on schema changes and migrating existing data but found nothing. This CANNOT be a new concept to SF.
Thanks,
Vance
So if the object was an account with id xxx and the new object was an opportunity the opportunity would be linked to the account by the Id xxx, then you would pull the value of the field from account xxx and paste it into the field of the opportunity that is linked to account xxx
You wouldn't even have to do this with Apex if you didn't want to, you could do this with the data loader and excel. You just need the link between the two objects which would be the first object's Id.
Thanks,
Are you saying I would MANUALLY copy and paste the values? In the Data Loader process, what are the high level steps invoved there?
I am very much used to how to make schema changes and migrate data using SQL scripts. I am still trying to figure out how to think SalesForce'ish.
I'm sure there are other ways to do this as well. But this is similar to what I did when I needed to upload several thousand wine tastings, and I wanted to connect them to an account and user ID.
I setup an excel template with the correct account ID, and User Id, for relationship fields (plus my other data of course) and then I uploaded it.
https://developer.salesforce.com/docs/atlas.en-us.workbook.meta/workbook/load_data_intro.htm