RecordID.TABLENO problem

superjetsuperjet Member Posts: 40
Hello experts,

I am trying to get Table ID from RecordLink."Record ID" field using code:
SomeTableID := "Record ID".TABLENO;

SomeTableID = Integer
"Record ID" = RecordID
(NAV 5.0 SP1)

Compiling this code I receive the following error:
The variable is not a record. 'Variable.Field' is invalid.
Why?

Any help appreciated.

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    There is a field named "Record ID" in the table "Record Link". Thus you can't name your variable in the same way. Just rename your variable.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • superjetsuperjet Member Posts: 40
    my results so far:

    using global variable with Subtype=RecordID => everything WORKS!
    using any field with Subtype=RecordID => DON'T WORK!

    strange :-k :-k :-k
  • superjetsuperjet Member Posts: 40
    There is a field named "Record ID" in the table "Record Link". Thus you can't name your variable in the same way. Just rename your variable.
    "Record ID" <> RecordID
    i have used some other field named "abc" with the same subtype RecordID, same error.

    nevertheless, i found that TABLENO works only with Variables, not fields.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    superjet wrote:
    "Record ID" = RecordID
    This looks to me as you defined a variable of DataType RecordID and name "Record ID".
    superjet wrote:
    I am trying to get Table ID from RecordLink."Record ID" field using code:
    If you are working in the context of the table "Record Link" you can't use a variable named "Record ID" because there is a field with the same name.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • superjetsuperjet Member Posts: 40
    I didn't use variable "Record ID". I have used straight this field with TABLENO function. :)
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    superjet wrote:
    nevertheless, i found that TABLENO works only with Variables, not fields.
    ](*,) ](*,) ](*,) ](*,) ](*,)
    Sorry, but there is the C/AL Symbol Menu where you could find any possiblity of your variables, fields, records... what ever! You should look at it at least.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.