Changing Field Types

I currently have a field type of selection, which only allows you to select one item in the list. Would it be possible to change the type selection to type multiselection? There's already information in the old field and I really would like to not abandon that information (or maybe is there a way to create the new multiselect field and populate it with the old select information for each record?)

  • Yes. You will need to change the settings in custom_edits table as well as wrapping the existing text it , and ,. If you find another field in custom_edits thats a multi select and replicate the config settings required into the required selection field settings in custom_edits it will change the field type in CRM. Multi selects uses comma's to differential the options so you will also need to change the text from, for example "Customer" to ",Customer,".

  • Right! I found the field I want to change and a field that I want to turn it into. I see that I'll have to change the entry type, entry size, and the data size.

    However, while I see that use of commas, I'm not sure behind the code to do that (change the text form).

    When I just change the entry type, and then add a few new multiple selections I get an error:

    An unexpected event has occurred: SQL Code: 8152
    SQL Code: 3621
    Exception: SQL Error

    If I change those other settings I'm hoping it'll go away.

    Now my guess to adding the commas, would look something like this?

    UPDATE Opportunity
    SET oppo_assignedtech = CONCAT(',',oppo_assignedtech,",")

  • Try

    UPDATE Opportunity

    SET oppo_assignedtech = ','&oppo_assignedtech&','

  • Well, it looks like I just updated the field with the information

    UPDATE Custom_Edits

    SET ColP_EntryType = 28, ColP_EntrySize = 5, ColP_DataSize = 255

    WHERE ColP_ColPropsId = '11594'

    It worked when I tried to create a new opportunity, and then worked again when I tried to modify an old field (click the change button and then multi-select).

    I haven't done the update to add the commas, are you sure it's necessary?


    When I try

    UPDATE Opportunity
    SET oppo_asstech2 = ','&oppo_asstech2&','
    WHERE oppo_asstech2 IS NOT NULL

    I get an error: "The data types varchar and nvarchar are incompatible in the '&' operator. So I tried:

    UPDATE Opportunity
    SET oppo_asstech2 = ','+oppo_asstech2+','
    WHERE oppo_asstech2 IS NOT NULL

    And I get "String or Binary data would be truncated. The statement has been terminated."

  • I figured it out. When making the changes, the UPDATE to the record should be just done all at once, and for adding the commas, I really wish there was a webiste that told you the correct SQL commands. I've got SQL SERVER 2008 R2 so sometimes certain commands for other SQL versions don't work, and it can be frustrating.