RecordId Problem

Marcu51Marcu51 Member Posts: 5
I try to update field in a database from a text file :

the text file contains :
RecID:<Campaign: CP1001> Field_Name:<Starting Date> Valeur Invalid date:<01/11/0205> Valid Date :<01/01/01>

The field to update is Field_name : The valid date must replace Invalid date

RecId is the recordId of the record to update

I don't know how to retrieve the record by the recordid

Please help me
Thank's

Marc

Comments

  • KonradKonrad Member Posts: 30
    TableToUpdate.Get(RecID);

    Where TableToUpdate is variable of type Record and subtype of the actual table.
  • krikikriki Member, Moderator Posts: 9,110
    Konrad wrote:
    TableToUpdate.Get(RecID);

    Where TableToUpdate is variable of type Record and subtype of the actual table.
    I tried this, but it doesn't work.

    Maybe you should try to use GETPOSITION and SETPOSITION and not RECORDID. I looked around to find something, but I couldn't find anything to make it work
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KonradKonrad Member Posts: 30
    edited 2008-01-11
    kriki wrote:
    Konrad wrote:
    TableToUpdate.Get(RecID);
    I tried this, but it doesn't work.
    ...

    You right, what was I thinking :)

    this should work though:
          EVALUATE(MyRecordID,RecID);
          RecRef.GET(MyRecordID);
        
          FldRef := items.FIELD(3);
          MESSAGE(FORMAT(FldRef.VALUE));
    
  • krikikriki Member, Moderator Posts: 9,110
    But only if your primary key has 1 field.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KonradKonrad Member Posts: 30
    kriki wrote:
    But only if your primary key has 1 field.
    Why is that?
  • Marcu51Marcu51 Member Posts: 5
    thanks all of you

    but some files have a multi field Primary key ...

    my problem seems very complex :(

    Marc
  • krikikriki Member, Moderator Posts: 9,110
    Konrad wrote:
    kriki wrote:
    But only if your primary key has 1 field.
    Why is that?
    :oops: :oops: :oops: , my error. I just checked and noticed that the GET of the recordref accepts an RecordID and not the primary fields.

    You're right:the GET will work fine.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Marcu51Marcu51 Member Posts: 5
  • Marcu51Marcu51 Member Posts: 5
    Thanks
Sign In or Register to comment.