Re: Range check exception
Here's an odd little bug, with annoying ramifications.
I just ran a test of Charles R's batch update to add determinations and ended up with two occurrences each with an additional determination added (which was the expected behaviour).
The I went to delete the new determinations (which were set as preferred). This caused an exception when I tried to save the changes.
exception class : ERangeError
exception message : Range check error.
So tried a different approach, I made the determination I wanted to keep preferred, then I deleted the other without incident. So this looks like a hole in the exception handling. What should happen is a message should tell the user "Can't delete the preferred determination" or similar (better still, the delete button should be unavailable when the preferred determination is selected).
Just prior to typing this I decided to test one more time to make sure I could reproduce the problem. I added a spurious determination and saved it. Then edited again and tried to delete the new determination which was set as preferred. Again on save I got the exception, but this time I clicked the Close application button inadvertently, instead of the Continue application button.
When I restarted Recorder I discover that the record in question now has two determinations, both of which are preferred (demonstrating very well why the concept of the SQL Transaction was invented, and also that it has not been implemented here). Worse still when I edit either determination, the preferred tickbox at the bottom is unavailable, so I cannot make either the preferred one. It turns out that I can delete the original determination (which I wanted to keep), but not the new one, which I don't want (because of the exception).
Finally I had to add another determination, identical to the original one. This had the effect of making the second determination no longer preferred and then I was able to delete it.
Everything seems to be back to normal for now...
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre