I have a layer with a relate table (1-M) with three columns (fk_id, date, comment).
fid | fk_id | date | comment |
---|---|---|---|
1 | 01 | 2021-02-03 | Comment 1 |
2 | 02 | 2021-02-05 | Comment 2 |
3 | 02 | 2021-03-02 | Comment 3 |
4 | 02 | 2021-03-25 | Comment 4 |
5 | 03 | 2021-01-11 | Comment 5 |
I have also created a custom form for the layer and table.
What I need is when I add a new record to the related table, the default comment must be the same as the last date for that fk_id
.
So, in this example, if I create a new record in the related table using the form, the comment should be Comment 4
.
I'm looking around the expression builder but I have no idea how to do this selection.
Anyone could give me a tip of how can I set this default?