Hi,
I make technical reports for machines. Every year a new report is done with a license date for one year which is
in a data field "valid until".
After the years you have some reports for one machine.
In a grid overview of the machines I like to show the field "valid until" from the latest technical report that was
made for the specific machine.
I tried in the grid events OnRecord
this shows the latest valid_until date of ALL machines.
I start the grid with a search form that displays the specific machine.
How can I set and transfer the parameter (machine_id) in the search form to the grid so that the search result
shows the correct valid_until date for the machine?
I know I need a WHERE in the sql query.... WHERE machine_id=???????
Any suggestions?
I make technical reports for machines. Every year a new report is done with a license date for one year which is
in a data field "valid until".
After the years you have some reports for one machine.
In a grid overview of the machines I like to show the field "valid until" from the latest technical report that was
made for the specific machine.
I tried in the grid events OnRecord
Code:
$sqlabndat = "SELECT MAX( valid_until ) FROM machine_data GROUP BY valid_until DESC LIMIT 1"; sc_lookup(licence_data, $sqlabndat); if ({licence_data} === false) { echo "<script type='text/javascript'>alert('Access error. Message = " . {licence_data_error} . "');</script>"; } elseif (empty({licence_data})) { {valid_until} = 0; } else { {valid_until} = {licence_data[0][0]}; }
I start the grid with a search form that displays the specific machine.
How can I set and transfer the parameter (machine_id) in the search form to the grid so that the search result
shows the correct valid_until date for the machine?
I know I need a WHERE in the sql query.... WHERE machine_id=???????
Any suggestions?
Comment