add lookup values dynamically
I currently have this code to add lookup values to lookup fields on my form dynamically. It works well, the only problem being that it resets the value of the field to null. I don't want it to erase what values might already be there. I currently have this:
- Locs = Locations[ID != null].ID.getAll();
- Trip_From:ui.add(Locs);
anyone have any ideas? i tried this workaround:
- Locs = Locations[ID != null].ID.getAll();
- myvalue = Trip_From.iD;
- Trip_From:ui.add(Locs);
- Trip_From = myvalue;
It works, but changing the value of the other lookup fields triggers the code that resets the first lookup field! So you get a vicious cycle going. I would only need this code to run when a user actually adds a value to the lookup list, but i can't find a way to do that.