Non-stop Flashing Windows using .CurrentRecord

Do not try this at home. (Unless you save all open databases first)

2 databases. Database A & Database B. The have a relation with a one to many (1 Record in Database A relates to many records in Database B.)

Create the below code in a .CurrentRecord procedure in Database A. Change the current selection in Database A and there will be a non-stop flashing as Panorama moves from file to file.

Hide
RememberWindow
SelectRelated "Database B"
OriginalWindow
Show

Contrary to the Help file, the NoShow and EndNoShow does not work identically. Though it also does not do what I was expecting.

From the documentation:

  • The .CurrentRecord procedure should definitely not ever change the current window.
  • it should not ever cause a further shift in the database position (for example doing a further search).

Your code is doing both of these things. So yes, do not try this at home.

In fact the documentation actually strongly recommend avoiding use of the .CurrentRecord procedure altogether. Panorama tends to give you great power to fuck things up, and trust you not to do that. Perhaps it would have been better to simply eliminate any feature that can be used incorrectly, but that’s not how Panorama rolls.

I can understand why you might want related data to be selected automatically in another database. But that is simply not possible in Panorama X. Not everything you can imagine is possible.

I was attempting to not cause any windows to change. (Isn’t our job to work within the rules but still getting what we want that people say can’t done? :wink:

The code was not doing a search within the calling db which is what I read the #2 no no to be saying.

If the Database B were in an OpenSecret situation, would this be ok to do?

I was originally attempting to display the related records in a Matrix object within a Database A form, but was stymied and not having any luck getting that to work. The documentation is a bit lacking with just a sentence or two on the data from a different db. I was hoping the above to be a short term workaround.

The code does work fine if the Hide/Show is left out. Is that still going to be a problem with the use of .CurrentRecord?

Database B does have 76,000 records but there does not seem to be any hit for performance when used in this situation. Is ‘See No Evil’ mean ‘There Is No Evil’?

I was attempting to not cause any windows to change.

Not possible. I have updated the selectrelated documentation to highlight the fact that this statement WILL switch to a different window, full stop. There is no way to get around this.

1 Like