
Copy contents of reference link to another field.

Hello.
The "Select" field you see in the screenshot is a "Link to" reference.
My intention is that whatever is selected, should be copied over to the "Description" field (text field).
I added a code to the "Trigger after update" section of the "Select" reference field.
let x := Select;
Description := x.Description1
But of course this doesn't copy the selection over and every time I change the selection field, it changes the "Description" field. So basically that "trigger after update" doesn't serve my purpose. How else could I accomplish this?
In FileMaker we used an editable selection field. We could select an item and then add some comment. In Ninox this seems not to be possible. Using choice fields, we can't amend the selection.
Any help or suggestion is much appreciated :)
-
Bernd Krell said:
Then I select something else and it appends it. Possible?Most things are possible. You can try this in your trigger:
let t := this; if Description = null then Description := Select.Description1 else Description := t.Description + " " + Select.Description1 end
Line 1 creates a reference to the current record.
Line 2 - 7 is an if statement that checks if the Description field is empty or not. If it is then it copies the data from the Description1 field from the Select link.
If the Description field is NOT empty, then it takes the content of the current Description field then adds a paragraph mark then adds the content of the Description1 field from the Select link.