Joining tables on Record ID within a Query Object

Greetings.

I’m attempting to join two tables within a Query object within an AL Extension. However the only link data between the two is the RecordRef.RecordID of table 1 stored in a “Record ID” field in table 2. I’ve tried referencing the “Record ID” field in table 2 with table1.RecordID as part of the dataitemlink, but the Query object won’t accept it.

Here’s what the code looks like:

query 50000 MyQuery
{
elements
{
dataitem(Table1; “Table One”)
{
column(fieldone, “field one”) {}
column(fieldtwo, “field two”) {}
dataItem(Table2; “Table Two”)
{
dataItemLink = “Record ID” = Table1.RecordID;

column(fieldthree, “field three”){}
}
}
}
}

Can I use RecordID to join between these two tables? Has anyone tried this linking tables using Record ID in a Query Object?