I would like to do multiple checkbox by retrieve the record from a table.
However I am not prefer to hardcode all the checkbox, but search for a solution which the checkbox can be automatically created based on the number of record in the table.
Please advise. Thanks in advance.
Not quite sure what you’re trying to archive. A “checkbox automatically created based on the number of records”???
Maybe you can share a bit more?
if you want to have checkboxes in a page without having bool fields in the table, create global variables of type bool in the page, add these variables to the field list in the page and set the needed assignments in the onaftergetrecord trigger. to initialze the variables use the onopenpage trigger.
works also in the same kind in reports.
For example, I have “department name” field in department table,
Field: Department Name
I want to place only 1 checkbox in request page and this checkbox link to this table and field. If this table has 10 Department Name, 10 checkbox should be appeared, if the Department Name in this table increase to 20, then 20 checkbox should be appeared, where I not need to manually add the checkbox.
Please advise how to do this?
Jonathan, is your solution work to what I required?
please describe in detail what you want to do.
what is your target, your aim?
I want to do sort criteria in request form, but there have more than 100 of field can be choose by user to do sorting. I do not want to hardcode 100 checkbox. Can the checkbox replicate itself depending the number of field in the table? Now you get me? Thanks.
what you want, is not nav standard behavior and not easy to solve!
it’s not possible to create dynamically controls in a request form (or somewhere else). so standard way of doing would be in that case to create the 100 checkboxes. i assume it should be possible to select more than one checkbox at one time, otherwise you could use a option field (with 100 values).
quick idea: lets say the table with 100 name values is called optionlist. add a new bool field to the table. then create a standard form with table optionlist as source table. in the form wizard select tabular view and add the name and the boolean field to the list of viewed fields. set the property sourcetabletemporary=yes. when this form is opened (trigger onopenform) load the records of table optionlist into the temp. source table of the form.
so, when opening that form, the user can check all the needed values. you can use this form as a kind of a request form. you only need to open the target report out of that form and forward the selected values to the report.