OpenSecret and selecting a record in a secret window


I am having trouble running the Pan 6 OpenSecret code in Pan X.

From the active database I run the code:
OpenSecret "Transaction"
Window "Transaction:SECRET"
Select … and the selection fails because the selection field does not exist.

This tells me the Pan X is trying to run the Selection from the original active database and not the Secret database

Am I missing something?


Well, you’ve left out the formula, which is the part where the error is happening, so that makes it difficult to make suggestions.

But in general, what you are doing should work.

Are you saying that this is code that did work in Panorama 6? If you want to make a selection in the Transaction database based on a value in the current record, I would expect something like this:

let key = ID
opensecret "Transaction"
setactivedatabase "Transaction"
select ID = key

This assumes that both databases have a field named ID, you would have to adjust for your actual field names. Note that

setactivedatabase "Transaction"

does the EXACT same thing as your

window "Transaction:SECRET"

line, in Panorama X you can use either but I think setactivedatabase is easier to understand (for the programmer, the computer doesn’t care one way or the other).

I would also expect there to be some sort of additional code since you have no way to see what the selection did. In fact, I would usually use arraybuild( instead of select, since I probably want the results somewhere else, something like this:

let key = ID
opensecret "Transaction"
let items = arraybuild(cr(),"Transaction",{Item},{ID = key})

This code will return a list of items in Transaction that match the ID in the current record.

The ability to use a query in the arraybuild( function is new in Panorama X, and very handy.