I have the following code:
var fsObjCenter = databaseManager.getFoundSet(serverName, “center”);
fsObjCenter.find();
fsObjCenter.status = “current”;
fsObjCenter.center_code = “^=”;
fsObjCenter.duplicateRecord();
fsObjCenter.center_code = “”;
fsObjCenter.seats = “^=”;
var recordCount = fsObjCenter.search();
I get the following error in the line fsObjCenter.duplicateRecord();
org.mozilla.javascript.JavaScriptException: java.lang.ArrayIndexOutOfBoundsException: 0
Please help!
I do not think duplicateRecord() is a valid function to call in findMode.
If you have a simple form and go into findMode, you can see in the Select menu that it is disabled.
Have you found this option somewhere in the docs?
Paul
You are right. In the findMode the duplicateRecord is disabled.
But the code controller.duplicateRecord() works perfectly like in filemaker.
It duplicates the find request.
When controller.duplicateRecord() works I would guess that foundset.duplicateRecord() should work.
Thanks!
Forwarded this to our engineering department. Tested with it and it does not seem to behave like expected.
Paul
Do you mean controller.duplicateRecord() does not work?
Servoy Developer
Version 3.5-build 513
Java version 1.5.0_11-b03 (Windows XP)
no, foundset.duplicateRecord doesn’t seem to behave like expected, as you established…
Paul
Hameed,
Duplicate record in find mode was added in Servoy 3.5.
fsObjCenter.duplicateRecord() should work also, there is however a small bug in handling the default parameters. If you pass in parameters it should work as expected.
Will be fixed in next 3.5. release.
Additionally, duplicate record will be enabled from the menu in find mode.
Rob