0
Select a field in a record in a linked table on Trigger new data set
Hi!
I have 2 linked tables: TAB-A and TAB-B
In TAB-B I have a number field named "nr"
In TAB-A I have a number field called "tax"
In TAB-A I have this formula in Trigger in new data set:
- let dtsel := (select TAB-B)[ID = 1];
- let aftax := dtsel.nr;
- 'tax' := aftax;
This formula gives me the following error:
the expression provides multiple values: aftax online...
Instead this other formula works:
- let dtsel := first(select TAB-B);
- 'tax' := aftax.nr
But I would like to make the first formula work because on other occasions I need to select different IDs.
Can you help me?
2 replies
-
When you use a select() command, Ninox always assumes multiple records will be returned even if only 1 record is found. So Ninox always asks you to tell it what to do.
You could do:
let dtsel := first((select TAB-B)[Id = 1])
or if you know the record Id, then may I recommend the record() command.
let dtsel := record('TAB-B',1); tax := dtsel.nr
-
Thank you for the comprehensive answer Fred
Content aside
- Status Answered
- 1 yr agoLast active
- 2Replies
- 134Views
-
2
Following