newRecord() error

I’m getting very strange results when I use the controller.newRecord() command in 2.2rc2-build 320.

If the form has just one record then the record is indeed created but the new record doesn’t get loaded to the form. Therefore any steps following are recorded to the existing singleton record.

However, if I run controller.loadAllRecords() just before creating the new record then the new record is indeed loaded and any following steps are recorded to this new record.

I get the same results whether the form is set for useSeparateFoundSet or not.

Is this predictable and proper behaviour (yet another gap in my understanding) or have I found a bug? :wink:

Please let us know, yes or no, is this a bug in Servoy or expected behaviour? Our way forward is blocked until we understand the status of this issue.

  1. More than 1 record in a form (tested with 200, 400), issue the newRecord() command and the new record becomes the current record.

  2. Only one record in the form, issue the newRecord() command, the new record is created but not loaded into the form. The original singleton record continues to be the only record loaded into the form.

Is scenario 2 expected behaviour?

not it is not. can you reproduce this with a simple one form solution?