Forum Discussion
_anomDiebolt_
11 years agoQrew Elite
>I still have the issue with not being able to log edits to lookup fields though.
A lookup field can only change when the [Related Parent] field changes. To get the old and new values of the lookup filed you have to perform two AJAX requests to the parent table using (1) values of the [Related Parent] stored in the hidden input associated with the [Related Parent] <input> as seen here for fid=7:
<input name=_fid_oval_7 type=hidden value='1'>
and (2) values of the [Related Parent] associated with the selected option of the [Related Parent] <select> as seen here for fid=7:
<SELECT size=1 name='_fid_7' id='_fid_7' ...> <option value="" style="color:#888888;"> Make a Selection... </option> <option value="1" >Record #1 - foo - 123</option> <option value="2" selected>Record #2 - bar - 456</option> <option value="" style="color:gray;" disabled>--------</option> <option value="_other"><Add a new record...></option> </SELECT>
The value of the lookup field from the AJAX call in step (1) will be the old value, while the value lookup field from the AJAX call in step (2) will be the new value. Note that even if a new parent record is selected it may be the case that the lookup field does not change value even though the related parent record does change - you may or may not want to note such a situation in your log.
A lookup field can only change when the [Related Parent] field changes. To get the old and new values of the lookup filed you have to perform two AJAX requests to the parent table using (1) values of the [Related Parent] stored in the hidden input associated with the [Related Parent] <input> as seen here for fid=7:
<input name=_fid_oval_7 type=hidden value='1'>
and (2) values of the [Related Parent] associated with the selected option of the [Related Parent] <select> as seen here for fid=7:
<SELECT size=1 name='_fid_7' id='_fid_7' ...> <option value="" style="color:#888888;"> Make a Selection... </option> <option value="1" >Record #1 - foo - 123</option> <option value="2" selected>Record #2 - bar - 456</option> <option value="" style="color:gray;" disabled>--------</option> <option value="_other"><Add a new record...></option> </SELECT>
The value of the lookup field from the AJAX call in step (1) will be the old value, while the value lookup field from the AJAX call in step (2) will be the new value. Note that even if a new parent record is selected it may be the case that the lookup field does not change value even though the related parent record does change - you may or may not want to note such a situation in your log.