Options

Simple question about Field type option!

jemmyjemmy Member Posts: 247
Folks,

This should be a simple question, but can make you mad if you are working in the pressure/short time. :x
How to change the data type of field in a table from option becomes text if there's already some existing data.
For example you want to change field "queue priority" from option to text or int.

Please advice me briefly.

Thanks in advance as always.

Jemmy

Comments

  • Options
    s.delikostovs.delikostov Member Posts: 32
    Make new field of type Option (for example Temp Option). Copy all data from old option to new field and delete all data from old field.
    Change field type to text or integer.
    Move data from Temp Option to the old field (with FORMAT or EVALUATE)
    Stamen Delikostov
    Navision Solution Developer
    Intelligent Systems Bulgaria
  • Options
    jemmyjemmy Member Posts: 247
    Thanks delikostov,

    one question, you said that I hae to delete all data from old field, how to accomplish this? I have set them to null, but it still contains option#0!

    pls advice further... again I appreciate your quick response.

    Jemmy
  • Options
    kinekine Member Posts: 12,562
    Set them to default value - 0.
    MODIFYALL(OptionField,OptionField::"0");
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    jemmyjemmy Member Posts: 247
    Thanks Kine, if I don't misunderstand, does it mean we have to set them for the first option..
    I would like to update this later..


    [-o<
  • Options
    kinekine Member Posts: 12,562
    Yes... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    jemmyjemmy Member Posts: 247
    It worked well yesterday, thanks buddy! O:)

    Cheers,

    Jemmy
Sign In or Register to comment.