Need help for reading the value of a fieldref

katerinakaterina Member Posts: 4
Hi. I use Navision 3.70 and I have the following problem.
fref --> fieldref
ref --> RecordRef

Here's the code of a function of a codeunit. The function's arguments as
tableno and position.

ref_mod(tableno : Integer;position : Text [250])

ref.OPEN(tableno);
ref.SETPOSITION(position);
fref := ref.FIELD(1);
message(format(fref.value));

Here's the deal: if the field is the primary key,is shows its value. If it is any other field it shows its initial value ('' for string, 0 for option etc). I can't get the real value of the specific record. :evil:
Does anyone know why this happens? How can I get the real value?

PS. Here's a usual call of ref_mod :
ref_mod(9,'Code=const(ES)');

PS2. Thanks for reading this.
Katerina Passali
Exodus S.A.
www.exodus.gr

Comments

  • SteveOSteveO Member Posts: 164
    Hi,

    Try using ref.FIND after your ref.SETPOSITION.

    According to the help SETPOSITION only sets the values of the primary key and does not actually get any info out of the DB.

    Hope it works :)
    This isn't a signature, I type this at the bottom of every message
  • katerinakaterina Member Posts: 4
    Hi, Steve0.
    Thanks so much!
    It worked! :D
    Katerina Passali
    Exodus S.A.
    www.exodus.gr
  • SteveOSteveO Member Posts: 164
    Glad to hear it!! :wink:
    This isn't a signature, I type this at the bottom of every message
Sign In or Register to comment.