saving field to database

Good day,

I so computations using the field variables, its fine and it dispalys the result on the form, however, when i looked into my database, I doesnt updat.
I use version 6 with form=>onloadRecord.
Also tried Grid application with onRecord with the same code, and same thing happend.

{total} = {gradeq1} + {gradeq2};

I am just new to scroptcase and just wanted to update these values to a database, I know i can update to another table but how can I save it to the current table that I am working?

Thanks

dmaico,

  1. “total” of course needs to be a field in the database.
  2. You need to make sure your application sql matches the database structure (use Application->Synchronize Table).
  3. You need to have clicked on the “Save” button when executing the application in order to rewrite the record containing the new value of “total”.

Hope this helps.

Dave

Thanks Dve,

  1. total is a field on the database
  2. structure matches with my table.
  3. I follow and save

I can see the variables and the value of total is computed on scriptcase but i can not see on my table
since I use the onRecord for computation, or onLoad in form applciation and OnRecord in grid application.
will this command save the value to my table?

 {total} = {gradeq1} + {gradeq2};

Thanks.

Try going into the form’s application settings and turn on debugging.
On the left menu, select Application, click on Settings and scroll to the bottom.
You will see a checkbox for Debug Mode.

You will then be able to see the SQL Update that is being sent to your database.

Dave

is there any command inside the even to insert the data to existing table?
I can only see update to another table and update.

There is a way to manually force the write in a validate event, but you should first find out what you are doing wrong that is preventing the automatic update.

In the form’s SQL setting, do you have the proper table/connection specified?

Dave

Everything is fine about the setting, The only thing I didnt do is to save the data, I am working on FORM-editing multiple records.
If I can click save selected record then thats the time the record will updated to my database.
I think the simply way to do is to click “save selected records” to save the data.
The problem is I have 500 records, I can not just click every record and save.

Is there a better way to do these? or is there a way to click all check box by default?
I try to go to settings,“click check box” YES but it doent work.

Thanks

Have you used triggers in the database table config?
It will allow you to put a formula in which updates the total fiedl when ever the record is rewritten of inserted… no code necessary in your form