In some cases, we need to select more than one option in the field, we can deal with this situation by grouping all of these options in a single selection and showing all the checkboxes in a single menu of options on the screen.
In this example, an “Editable Grid” Form will be developed using the Multi-Selectable Combobox feature .
Creating a Form with Multi-Selectable Combobox
note:If you have any questions on how to create a Form, go to: Creating a new Form
1. Create a new application of the form “Editable Grid” based on the “tasks” table .
2. After creating the Form, in the application menu access the “Field Positioning” tab .
3. Select the fields: projectid, taskname, startdate, finishdate, percentcomplete and taskpredecessor.
4. Once this is done, select the “Fields” tab in the application menu and access the settings of the “projectid” field .
5. Navigate to “Edit Lookup” and replace the SQL code present in the text box with the code below:
SELECT projectid, projectid
FROM tasks
ORDER BY projectid
The Edit Lookup will look like this:
6. Still in the “Fields” tab , access the “taskpredecessor” field settings .
7. Once this is done, when accessing the general field settings, change the data type to Select , as shown in the image below:
8. Next, navigate to “Edit Lookup” and apply the code below:
select taskid, taskname
from tasks
where taskid <> {taskid} and projectid = {projectid}
order by taskname
9. Now, activate the options “Multiple Values” and “Use Checkbox in Dropdown” as shown in the image below:
10. Having made the changes above, the “taskpredecessor” field will return the multiple values in Dropdown format , as well as the image below:
11. Finally, click on the “Run” button on the toolbar.
To see more examples created using Scriptcase, go to: Examples: Complete Systems and Applications with Scriptcase.
Comment this post