Problem inserting records in Form

Hi all,

I have the following method that gets called on open form:

////////On open form create a new record in form A
				controller.newRecord();
				var str = application.getTimeStamp();
				str += security.getUserName();
				userkey = str

And the following method gets called once users click on Insert button to insert a record from Form A to B:

/////////////////////////Copy the current record from Form A to B
var meesage = "";
message = 'Do you want to save the record?\n';
var message = plugins.dialogs.showInfoDialog( 'Result', message, 'YES', 'NO');

if (message == 'YES')
{
//////////////////////Create a new record in foundset
//Create a new record in foundset
forms.BEH_NEPSY.controller.newRecord();

for( var i = 1 ; i <= foundset.getSize() ; i++ ) 
{ 
var srcRecord = forms.beh_nepsy_2.foundset.getRecord(i); //src foundset 

var destRecord = forms.BEH_NEPSY.foundset.getRecord(forms.BEH_NEPSY.foundset.newRecord()); //dest foundset 
if (srcRecord == null || destRecord == null) break; 
databaseManager.copyMatchingColumns(srcRecord,destRecord,true) 
} 

//Save ANY outstanding change to dest foundset 
controller.saveData();

Both methods above were used to work fine in Servoy 2.1.X but since we upgraded to 3.X no record has been saved to any form that uses such method.

Cold some please let me know why Servoy is behaving this way.

Thanks in advance,

Abrahim

I tried to reproduce this problem with 3.5. I used exactly the code you pasted in the previous post (only one more “}” was needed) - executed for “onShow” and for the “Insert” button action. I created the two forms and for each form a table with the same name as the form and compatible fields.

For me it worked as it was supposed to. Created a new record when entering the form and created one record in the other table + copied one record from the current table to the other table when Insert was pressed (so +2 records in the other table). Also worked as expected when more than 1 record was added before pressing insert…

Do you still have the problem with 3.5 release? If so, I would need a sample solution to investigate further.

Andrei,

The problem is gone after we upgrade to 3.5.

Thanks,

Abrahim