In my code I want to update values in database. What I need to do is, I am having two buttons event in two forms
a. In formA event is to create a new record and saved the information such as id, start time, so on.
b. In formB I need to add rest of information such as stop time, time difference between start and stop time.
In form B I am using plugins.rawSQL() to update existing data, but it throws error: TypeError: rawSQL is not a function, it is org.mozilla.javascript.NativeJavaObject.
Do I really need to use plugins.rawSQL() to update the record. Is there any other way where I can add form b data in existing record. Please suggest.
I don’t know what it is that you are trying to do exactly but normally you would create two forms based on the same table.
- In formA to create a new record and fill some fields:
foundset.newRecord();
foundset.fieldname1 = 'value1';
foundset.fieldname2 = 'value2';
- In formB if it is based on the same table the same record will be the active one. If not lookup the correct record first. Then update the rest of the fields:
foundset.fieldname3 = 'value3';
foundset.fieldname4 = 'value4';
You don’t have to use the rawSQL plugin for that. The record will be save automatically if all the required fields are filled. Of course if you want to explicitly save the record you can do that as well.
Omar
Thanks both of you. Good info