Are there circumstances in which the following code could be expected behaviour?
var max1 = controller.getMaxRecordIndex(); // 37
var peoid1 = people_id; // 184
var test = controller.newRecord(); // true
controller.saveData();
var max2 = controller.getMaxRecordIndex(); // 37
var peoid2 = people_id; // 13
People_id for the next new record should be 1659 and indeed that record is created. However because it’s not loaded into the current form any steps following the above code will take effect on the wrong record.
There are no param filters running anywhere in the solution.
Can the solution itself cause this problem or am I correct in assuming this phenomena is due to a bug in Servoy and/or Sybase?
For the past three weeks I’ve been experiencing this bug in circumstances where the form has just one record. loadingAllRecords() just ahead of newRecord() has solved it. Today I’ve identified one script in which it doesn’t matter how many records are loaded in the form. The new record is not loaded and in this case the current record jumps from 184 to 13.
Version R2 2.2rc3-build 321
Java version 1.4.2_06-b03 (Windows XP)