0

How to select current register within 'select' function

Hi,

I need to select all records linked to XXX register in a given table .

i.e.:

Table named 'VEHICLES': 

Registration: XXX

S/N: YYY

etc

which has a child table called 'Status' and which has some registers

I need to show all registers which are related to current mother table 'VEHICLES' for a certain registration XXX

I've written this function:

select 'STATUS LIST' where AERONAVES.'Matrícula' ="_________"

which works fine if I write any registration in my database code, but I want current 'VEHICLE'shown is selected automatically for not to edit it.

I thought that only placing 'this' parameter would solve it, but I didn't manage.

Could some one help me?

Thanks.

2 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    There is probably a reason that escapes me and sharper minds can tell us why, but Ninox does not like to use 'this' in filtering. You can put 'this' in a variable. Then use the variable in filtering and Ninox is all happy.

    I'm not sure what you are trying to accomplish cause you talk about the VEHICLES table and a STATUS LIST table.

    But let us say you in the VEHICLES table and want to find the records in STATUS LIST that match the current record in VEHICLES. You can write something like:

    let t := this;
    select 'STATUS LIST'[Registration = t.Registration]
    
    • Alain_Fontaine
    • 1 yr ago
    • Reported - view

    I tried to explain my understanding of this issue here:

    https://forum.ninox.com/t/h7hrz3a?r=83hrsl3

Content aside

  • 1 yr agoLast active
  • 2Replies
  • 159Views
  • 3 Following