How to get a recordRef

Arjan_SomersArjan_Somers Member Posts: 64
edited 2006-08-01 in Navision Attain
Hi everybody,

I want the to get the recordRef to the current Rec.
I know there is no such thing as Rec.getRecRef.
But what is the best way to get a RecRef variable to point to my Rec?

Answers

  • pduckpduck Member Posts: 147
    I don't really understand your problem.
    RecRef.GETRECORD or RecRef.SETRECORD isn't the solution?
  • Arjan_SomersArjan_Somers Member Posts: 64
    No not exactly.
    I have a RECORD called Rec
    And a RECORDREF called RecRef

    The Rec is initialized, the RecordRef is not.
    Now i want the RecRef to point to the same Record as Rec.
  • DenSterDenSter Member Posts: 8,307
    There is a RecRef example in the download section. See if you can find it and take a look at the code in there.
  • pduckpduck Member Posts: 147
    No not exactly.
    I have a RECORD called Rec
    And a RECORDREF called RecRef

    The Rec is initialized, the RecordRef is not.
    Now i want the RecRef to point to the same Record as Rec.

    So why does RecRef.GETRECORD(Rec) doesn't fit? Do you have any Filtergroups or something on the Rec? If you want that RecRef does only points to the current pointed Recordset in Rec you can append a RecRef.SETRECFILTER();
  • Arjan_SomersArjan_Somers Member Posts: 64
    It looks like a usable function, but according to help i have to use it like this:

    RecordRef := recordid.GETRECORD

    I tried:
    RecRef.GETRECORD(Rec)
    and
    RecRef := Rec.GETRECORD;

    And they both don't work.
    For First one the compiler says it can't find the GETRECORD function,
    And for the second one it gives an error about an invalid type conversion.
  • pduckpduck Member Posts: 147
    pduck wrote:
    I don't really understand your problem.
    RecRef.GETRECORD or RecRef.SETRECORD isn't the solution?

    Sorry I meant GETTABLE and SETTABLE!
    GETTABLE (RecordRef)
    Neue Firmennotiz schreiben

    Use this function to make a recordref variable use the same table instance as a record variable.

    RecordRef.GETTABLE(rec)
  • Arjan_SomersArjan_Somers Member Posts: 64
    Does SETTABLE also sets the recordRef to the current record, or does it just set the recordRef to the Rec's table?
  • pduckpduck Member Posts: 147
    Does SETTABLE also sets the recordRef to the current record, or does it just set the recordRef to the Rec's table?

    It sets a Record to the RecordRef Instance.
  • Arjan_SomersArjan_Somers Member Posts: 64
    SOLVED
    RecRef.SETTABLE(Rec) does not only set the table no., but also makes the RecRec point to the same record and applies the same filters to the RecRef.

    Thx a LOT for your help! =D>
Sign In or Register to comment.