form development [message #594213] |
Mon, 26 August 2013 05:11  |
 |
nkumar0130
Messages: 55 Registered: August 2013 Location: Bangalore
|
Member |
|
|
I have a requirement to develop a form from scratch level.
The form contain search criteria and a search button.
On pressing the search button it will display the search result just below the search criteria.
The search result contain two button, EDIT and DELETE button in each row.
I am new to this form development can anyone please help me regard this.
|
|
|
Re: form development [message #594215 is a reply to message #594213] |
Mon, 26 August 2013 05:25   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Your requirement is - in other words - called reinventing the wheel. Forms does everything you described by itself, you don't have to do anything about it. Here's how: - create a form using data block wizard
- data block is based on a table
- run a form
- enter query mode
- enter values you are interested in (that is your "search criteria")
- execute query - results (if there are matches) are displayed on the screen
- EDIT: click any item, modify its values, COMMIT changes you've made
- DELETE: Forms toolbar contains the "delete record" button. Navigate to a record you want to delete, push the button, COMMIT these changes
Your description requires some programming; search criteria items are, most probably, not database items. In order to fetch correct data, you then need to set data block's DEFAULT_WHERE (or ONETIME_WHERE) condition (using SET_BLOCK_PROPERTY built-in) or, alternatively, use PRE-QUERY trigger to put search criteria items' values into data block items. Deleting can be done with a WHEN-BUTTON-PRESSED trigger which would call DELETE_RECORD built-in. Editing: no idea what you plan to do with that. Open selected record in another data block (a new canvas?)?
All in all, you can do that simple, easy and error-free, or you can do that in a complex, difficult and error-prone way. Pick one.
|
|
|
|
|