Get Fieldvalue by Number

kszymanskikszymanski Member Posts: 42
edited 2005-06-17 in Navision Financials
Hi!

i want to save the content of a table in a file. I have a array (Integer) with all Fieldnumbers i wan't to save in the File (last item ist a 999999 to find where to stop). The following Code is only an not working example to show the problem i want to solve.
IF Table.FIND('-') THEN
REPEAT

  Index := 1;
  REPEAT

    // Here the problem comes :) I wan't to save the
    // Value of Fieldno $Fieldnoarray[Index] into the file...but
    // i dont know how to do this ;)
    Filehandle.WRITE(FORMAT(Field.??? )) 
    Filehandle.SEEK(Filehandle.POS - 2); 

  UNTIL Fieldnoarray[Index] = 999999;

  Filehandle.WRITE('');

UNTIL Table.NEXT = 0;

Thanks for your help!

Best regards,
Kai.

PS: I know i can use Filehandle.WRITE(Table) to save the content...but
thats not what i want ;)
--
Kai Szymanski
Abt. eBusiness
D. Schuricht GmbH & Co. KG

Comments

  • Timo_LässerTimo_Lässer Member Posts: 481
    With Navision Financials (2.xx) you can't do this because you cannot access the field values dynamically.
    In Navision Attain (3.60 ..) you can use RecordRef and FieldRef to access the values dynamically.

    Example:
    RecRef.OPEN(Customer);
    IF RecRef.FIND('-') THEN
      REPEAT
        FOR I := 1 TO RecRef.FIELDCOUNT DO BEGIN
          FldRef := RecRef.FIELDINDEX(I);
          FileHandle.WRITE(FORMAT(FldRef.VALUE));
        END;
      UNTIL RecRef.NEXT = 0;
    
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
Sign In or Register to comment.