Yes, this is possible.
You will need to write a 'Before Form Piece' - a small PHP script that gets executed before the form is loaded.
Within it, you can specify a SQL statement, query the database and put the
results into your form.
The values of a select-list have the form 0;foo;bar so all you need to
do is to dynamically build a string with the desired values and then
provide it to the function mentioned below. Here is a sample Before Form Piece:
$this->execPieceByName('ff_InitLib');
$test = "";
for ($i = 0; $i < 10; $i++) {
$test .= "0;Product {$i};value{$i}\n";
}
function ff_setSelectList($name, $value)
{
global $ff_processor;
for ($r = 0; $r < $ff_processor->rowcount; $r++) {
$row =& $ff_processor->rows[$r];
if ($row->name==$name)
$row->data2 = $value;
unset($row);
} // for
} // ff_setSelectList
ff_setSelectList('select1', $test);
To use it, Go to your form's properties and then to the 'Advanced' tab > More
options. In the popup window that opens, select the tab 'Form pieces.' In the BEFORE FORM section, choose the 'Custom' radio button. Paste your script in there and then make changes as needed. (You will probably want to replace the static 'for' loop with your SQL
query.)
![]() |
Was this helpful?
Yes
No
Print
Pdf
|

