0

How to store a record id in another field?

I have a separate table named GV for storing globals session variables. It works great with one exception; it fails when I attempt to store a record id like this:

record(GV,1).(t := id)

The 1 is the GV table record number and "t" is the name of a text field in the GV table where I want to store the id. In the process of testing, I attempted to assign an id to a local text field and to a number field. The assignment to a number field always fails. The assignment to a text field shows a value of "B6" for record number 6.

Based on this, I assume id fields have a special field type. How can I save an id to my global variables table and later retrieve it and use it to pull up a record. Does it need to be converted to a special field type and later be unconverted?

2 replies

null
    • Sean
    • 5 yrs ago
    • Reported - view

    Westy, I store Id's in a Number field and it looks like you have to assign the Id to a variable to copy it to another record.

     

    let tId := number(this.Id);

    record(GV, 1).(t := tId)

    • Choices_Software_Dean
    • 5 yrs ago
    • Reported - view

    Works every time now. Thank you!