This template can be used to set up a simple application providing create, update and delete operations against a database. It contains two screens, one for searching and listing records, and one for editing an individual record. You can download and Import the project export zip file below. You can also download and use the SQL script files to populate a suitable database with dummy data for test purposes or you can use your own database tables as required.
You can watch the video on how to use the CRUD template using this link WebMaker CRUD Template Video
NOTE: This project template is designed for Hyfinity WebMaker users only. It can be reviewed by BizFlow WebMaker users, but it does not include bizflow integration.
Usage:
You can watch the video on how to use the CRUD template using this link WebMaker CRUD Template Video
NOTE: This project template is designed for Hyfinity WebMaker users only. It can be reviewed by BizFlow WebMaker users, but it does not include bizflow integration.
Usage:
- Using FormMaker, go to the Page Structure tab for the List page, and select the Database data source on the right hand panel to pop up your database settings. [/*]
- Complete the necessary database configuration information and select your database table from the resulting dropdown, containing your tables. Choose the List Records option. [/*]
- Drag and drop the repeating record structure on the right hand panel into the PagingTable repeat on the page structure. Drop the contents when the repeat structure is highlighted in red to ensure the data source contents are merged with the existing 'blank' repeat container.[/*]
- Switch to the Edit page using the Page dropdown on the top left hand corner.[/*]
- Select the database table again, and this time choose the Edit Single Record option. [/*]
- Drag the details onto the page into the form_content group (with Form Details label).[/*]
- Select the checkboxes for all three actions in the popup, and choose the appropriate SQL Operations: Update for the update action, Insert for create, and Delete for delete.[/*]
- Hide any id fields by dragging and dropping the hidden control from the left hand control palette of primitive controls over the id fields in the page structure. In the Contacts example, drop the hidden control when the CID field is highlighted in red. [/*]
- Generate the application using the buttons on the top right hand corner and return to the Application Map tab. [/*]
- Open up the rules for the SearchRecords controller, and configure the SQL Statement action for the Retrieve all rule to ensure the correct search will be performed.
Eg: SELECT * FROM table_name where field1 LIKE $criteria OR field2 LIKE $criteria;
For the $criteria parameter, enter XPath: concat('%', /mvc:eForm/mvc :D ata/mvc:formData/mvc :s earch_criteria, '%')
Within the context of the Contacts SQL example, if we want to search for the first or last name for example, the select query would look like:
SELECT * FROM contact where FirstName LIKE $criteria OR LastName LIKE $criteria; [/*] - Save and close the rules tab. [/*]
- Open up rules for the GetRecord controller, and adjust the SQL Parameter for the Retrieve rule.
Eg: Set the id SQL parameter to /mvc:eForm/mvc :D ata/mvc:formData/mvc :s elected_record_id. You can drag and drop this from the left hand panel.[/*] - Add a condition to this rule so that it will only fire for the +?+?++viewRecord+?+?+? action. Drag and drop a condition into the rule from the top menu.
Eg: Use condition check of: /mvc:eForm/mvc:Control/mvc:action[. = 'viewRecord'] [/*] - Save and close the rules tab. [/*]
- Go to the Data Bindings tab for the List page and select the edit_button field on the left. [/*]
- Ensure that the Value to set event xpath is correctly pointing to the ID field in your data. In the Contacts example, drag and drop the CID field from the bindings document on the right hand side to the xpath entry field in the Page Display Bindings in the centre.[/*]
- Generate Application and Deploy All to run and test your application using the Dashboard. [/*]
Attachment