I have a short easy question for which I didn’t found a solution in the forum. Is it possible to make a form which can just add data to a table but nor read data from the table and which isn’t allowed to navigate through the records ?
I tried to set the navigator to none and added the following code to the onLoad method:
function onLoad(event) {
//start a transaction
databaseManager.setAutoSave(false);
databaseManager.startTransaction();
controller.newRecord(false);
}
But this was not working I got the following error:
Foundset accessed while not initialised (possibly in form.onLoad method)
Running Servoy 5.2.7 with WC.
Any idea how can I achieve the desired behaviour ?
so I will describe a little bit the workflow. The whole solution will run in webclient and consist of 6 screens/forms.
1st form: Show some welcome text and set filter criteria which were stored in global variables
2nd form: based on the filter criteria show an overview with available dates
3rd form: The form which I am talking about: Start a new transaction and create a record in the request table, but no other (previous request) should be visible
4th form: Show the enter request and be able to add request details to this request which is stored in a related table.
5th form: Show an overview over the request and the details and include an confirm button. After the button is pressed the transaction is committed and form 6 is shown if the cancel button is pressed, the website left or nothing is done the transaction is rolled back and no data is saved in the tables
6th form: Showing thank you for your interest and quitting the application.
I think the easiest way is to load an empty foundset in the data entry form and then create a new record before showing the form at step 3; when the user is done you save the record to the db (step 5).
You can use somthing like this:
var fs = databaseManager.createFoundset('myserver','mytable')
fs.newRecord()
forms.DataEntryForm.controller.loadRecords(fs)
forms.DataEntryForm.controller.show()