If the lookup source field on form A has a unique list of values a script can be used to get the record from form A and populate the field on B: var = formA [lookupsource == input.lookup]; input.textfield = var.pippofield;
If the source field on form A has duplicate values, the lookup field can point to the ID field, using the advanced display options of the lookup to display other fields of form A in the lookup. The script would be as below. var = formA [ID == input.lookup]; input.textfield = var.pippofield;
FormA= ID, name, serial (eg. 1-AAA-5, 2-BBB-6, etc)
FormB= Lookup (take and show from formB name and serial) - History
When I update the lookup field of FormB, I want that the previous value of the lookup field is copied in history.
Eg. lookup is "AAA-5", i update to "BBB-6", the value "AAA" must be writed in history.
So, on edit-validate formB, I have to take the old value of lookup field in FormB, select the serial part, search formA with the serial (which is unique) to find the value (AAA), assign to a variable and write in field history.
I tried :
var = formA [serial == old.lookup.serial].name; input.history = var.history;
(maybe you can use ID and write = var = formA [ID == old.lookup.ID].name; )
it's the ".name" that make the difference.
Leave a comment on eliaspallanzani's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic