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 :)
7 replies
-
If the Description field always has to show the text of the selected item, you could make the Description field a formula field (instead of a text field) with in the formula the Select field. The Description field then always shows the Select field
-
What about this?
Description := text(Select) *on the trigger After Update* -
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.
-
Fred Sorry for the delay and replying. I was away.
Tried your code and it works perfectly, doing exactly what I needed :)Thanks a lot, great help.
Content aside
- Status Answered
- 2 yrs agoLast active
- 7Replies
- 125Views
-
4
Following