Here’s something strange. The following method is designed to load all records with a “L1” designation with a “kind” field with a value of 1.
Here’s the “gotolevel$to_test” self-relationship:
gkey = key1
gkind = kind
globals.gkey = 'L1';
globals.gkind = 1;
controller.loadAllRecords();
controller.setSelectedIndex(1);
controller.loadRecords(gotolevel$to_test);
If there are multiple records currently displayed it works. However if there’s only one record current, sometimes it works, but most of the time it doesn’t.
Use the Omit button provided to omit all but “Test 1b”, then use the “GotoLevel1” button. The first time you do this it will work and show all L1 records with a Kind of 1. Omit one of them and use the GotoLevel1 button a second time. Now you’ll see only the one record. Do a ShowAll and try the GotoLevel1 button again and you’ll only see the one record, not all. Once it goes wrong the routine stubbornly wants to stay that way. The only way to shake it then is to go into Design mode and then return.