- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 05:00 AM
Hi,
I have a requirement to change the choice field to List field type. In this case how to update the old records, which are having choice values in that particular field.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 05:14 AM
Hi,
If you modify the type of the field it will delete all data from the column for all records. It might have impact on the performance also if the table is huge(data in the table)
I will suggest you make a new list column and use that going forward and remove the choice field from the form, rename it may be to ensure users don't use it in reports or something.
If you still want to update the type(not recommended) then the way to do it would be ,
- create a temporary field
- copy the data in temporary field
- change the type of choice field to list
- copy data form temporary field to list field
- delete temporary field.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 05:14 AM
Hi,
If you modify the type of the field it will delete all data from the column for all records. It might have impact on the performance also if the table is huge(data in the table)
I will suggest you make a new list column and use that going forward and remove the choice field from the form, rename it may be to ensure users don't use it in reports or something.
If you still want to update the type(not recommended) then the way to do it would be ,
- create a temporary field
- copy the data in temporary field
- change the type of choice field to list
- copy data form temporary field to list field
- delete temporary field.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 05:19 AM
Hi Anurag,
- Creating a new field will be a little problem, because there are client scripts, Ui policies written on that field. So making that existing field inactive will become a challenge.
- Creating a temporary field means, which type should i need to create choice or list, and could you please provide me rough script to do this.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 06:25 AM
Hi,
For 1) the scripts anyway have to be modified as currently the read and set value on a choice field, and now it will be changed to list, so the way you process these fields is different.
2) to copy the data, where is the list field pointing to now? you have to get that sys_id and then add it to the list.
Im assuming that the choice value in the field is also present on the table where the list field is referring to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 06:37 AM
Yes Anurag, the same choice values are created in referred table.