How to auto-fill the relationship field choice?
How to auto fill this relationship field when I create new record, instead of click into the field and choose what record. I want it auto fill because the date is just the latest date, so I don't have to click on it 2 times. can someone help me with this please?
28 replies
-
If the table NGAY THU/CHI has a date field called Date then you can test it out in a button with:
let selectNGAY := first(select 'NGAY THU/CHI' where Date = today()) 'NGAY THU/CHI' := selectNGAY
Line 1, does a select statement that goes to the table NGAY THU/CHI (assuming that is the name of the table as well) and finds all records where the Date field equals today’s date. Then you have to use the first() command, even if you only return 1 record, so Ninox only has 1 record to work with.
Line 2, sets the reference field ‘NGAY THU/CHI’ to the record found in line 1.
-
I have try but it not work it said: 1. Ngay Thu/Chi is not found, line 1 collum51
2. symbol expected, line 1 collum51
3. unexpected keywork, line 1 collum 56
4.End expected, line 1 collum 56
-
In the Shipping table, you can add a button with the following code:
let selectNGAY := first(select 'THU/CHI' where NGAY = today()) 'NGAY THU/CHI' := selectNGAY
This is link the first record in THU/CHI that has today's date to the current record in Shipping.
Content aside
- Status Answered
- 8 mths agoLast active
- 28Replies
- 180Views
-
3
Following