Dataport Problem

costasd3costasd3 Member Posts: 5
edited 2004-05-12 in Navision Attain
Hi,

I am new to navision and i am trying to make a dataport to import data from an ascii file. One of the fields that i have to fill in is an option field and i use one of the field options in the dataport as the value.
i.e. VarReccord.SETRANGE("Field Name",VarReccord."Field Name"::"Field Option"); and i get back : "The expression text cannot be type-converted to a option value"

Any Ideas on how i can solve this issue?

Thanks

Costas

Comments

  • GoMaDGoMaD Member Posts: 313
    Try this using the Integer value of your option field

    Greetings
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • costasd3costasd3 Member Posts: 5
    Can you write the full syntax please?
  • GoMaDGoMaD Member Posts: 313
    You can represent an option value by it value:

    option::Value

    or by it's integer value (starts from 0), the fastest way to find the correct integer value for your option value, is to look at the OptionString that you can find in the Properties of you Option Field
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • costasd3costasd3 Member Posts: 5
    Thanks
  • SimonWSimonW Member Posts: 77
    VarReccord.SEFILTER("Field Name",'%1',VarReccord."Field Name"::"Field Option");
  • chandruchandru Member Posts: 15
    This also will work... just put format before the argument..FORMAT(VARIABLE.FIELD::FIELDOPTION)
    You cannot discover new ocean unless you have the courage to lose sight ofthe shore.
Sign In or Register to comment.