Page 1 of 1

Writing to a Database on button click

PostPosted: Mon May 14, 2018 12:55 pm
by lavitista
Hey Everyone

This is my first time on the forum and I have a really basic question.

Not sure if I can ask this since its so basic, but here goes:

I am trying to write data to my database, from my textfields when I click my save button.
I really have no clue how to do this.

Regards
Lavesh

Re: Writing to a Database on button click

PostPosted: Mon May 14, 2018 1:16 pm
by ROCLASI
Hi Lavesh,

First of all, welcome to the forum.
As for basic questions, of course you can ask them here. Also there are no stupid questions, only stupid (or should I say wrong) answers.

You can save ANY unsaved data using the following command:
Code: Select all
databaseManager.saveData()


When you want to save only a specific foundset you can pass the foundset like so"
Code: Select all
// when called from the form itself
databaseManager.saveData(foundset);

// when called from another form or global scope
databaseManager.saveData(forms.myForm.foundset);


You can also save one specific record, like your selected record like so:
Code: Select all
databaseManager.saveData(foundset.getSelectedRecord());


You can find more information about the databaseManager in the Wiki.


Hope this helps.