Title: Best practice to change a field from a character FD to dropdown.
**
 
Dan,
 
Here is one approach to converting to a Selection field:
 
1. Determine how many distinct values you have.  i.e.  SELECT DISTINCT Char_Field_Name FROM My_Form_Name.
 
2. Add a Selection field to the form.
 
3. Add each entry to the list of selection options in the order you want the users to see.
 
4. Update the selection field in SQL, one command for each possible value (you could create one large SQL command, but if this is only going to be run once I prefer quickest option)  i.e. UPDATE My_Form_Name SET My_Selection_Field = 0 WHERE My_Form_Name = 'Apples'.  .... UPDATE My_Form_Name SET My_Selection_Field = 1 WHERE My_Form_Name = 'Bananas'.
 
5. Delete the character field if you no longer need it.
 
HTH
 
 
Stephen
 


From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Ian Trimnell
Sent: Thursday, September 21, 2006 8:32 AM
To: [email protected]
Subject: Re: Best practice to change a field from a character FD to dropdown.

** Dan Caissie wrote:
**

Ok I have a character field that I need to change over to a dropdown.

I need to do this with out losing the data for the character field, I guess I just looking for a best practice for this.

AR 6.3

Thanks,

Dan Caissie

Dan,

Depends whether you actually want to change the field Data Type to be an enumerated field or whether you just wish to change the Display Type to be 'Drop-Down List'.  The latter is useful as it makes users actually choose form an item on the attached menu rather than typing in something themselves.  Obviously you can't actually change the field Data Type to be 'Selection', you would have to create a new field and map the old data across to the new field.

Hope this makes sense.

Ian

Ian Trimnell, AR System Lead Developer (amongst other jobs),
Specialist Support & Information Team, Academic & Administrative Computing Service
Open University, MILTON KEYNES, UK
Phone: 01908 653741   web: http://www.open.ac.uk/
__20060125_______________________This posting was submitted with HTML in it___ __20060125_______________________This posting was submitted with HTML in it___

Reply via email to