I have an issue looking up fields in one database from another that is randomly, but mostly broken. Seems similar to staylor’s issue from Nov '16. Have spent many hours on it - something that worked flawlessly in Pan 6 for over 20 years.
If I click on the Calendar DB matrix, it figures out the date and time -> VisitDate and TimeSlot. It then goes to the Transaction DB in a secret window to see if that visit slot has been invoiced before to decide if it edits the existing or creates a new invoice. I carefully switch to Trans DB and try Select «24AVisitDate» or the full phrase: “Find «24AvisitDate»=VisitDate AND ApptTime=(TimeSlot-1)*900+lv1”
I get the error message “that field does not exist” - almost any version or statement to find info from that DB stops and doesn’t execute.
Testing a simple macro to look up those fields and couple other up/down record and display them in a message is erratic. If I open up the calendar, then open Transactions from secret to visible, this will execute the first message then stop, reliably. If I click on the calendar window and back to transactions, it will execute both messages once or twice then lock up after the first message statement. Once locked up, it will only return the first message.
Here is some more stable behavior
When called from the Calendar DB via FarCall this stops after the first message:
window “Mac DO Trans:Secret”
firstrecord
Message «24AVisitDate»
DownRecord
message «T2PtName»
But this one will work correctly repeatedly:
window “Mac DO Trans:Secret”
firstrecord
Message «24AVisitDate»
SetActiveDatabase “Mac DO Trans”
DownRecord
message «T2PtName»
Placing an info(“databasename”) statement after each step reveals that the active database switches from “Mac DO Trans” to Mac DO Cal" after the Message «24AVisitDate» statement and again after the message «T2PtName» statement.
It also reveals that the FarCall statement does not work with the fields and info in the DB where the FarCall procedure resides. Without making the "DB:Secret " immediately, it won’t work at all. I don’t believe this is the way the documentation says and not the way Pan 6 has worked.
If I get my test info from the Visitdate and ApptTime via lookups, it works perfectly: find lookup(“Mac DO Trans”,«26PtID»,CurrentPt,«24AVisitDate»)=VisitDate AND lookup(“Mac DO Trans”,«26PtID»,CurrentPt,«ApptTime»)=(TimeSlot-1)*900+lv1
I can do this from the Calendar DB or from within the Transaction DB looking up fields in itself.
I have noticed that my farcalls and secret window procedures sometimes seem to revert back to the calling or frontmost database after random commands, but haven’t been able to track it down as carefully as this.
Any ideas on what is going wrong?
Sorry for the long post, but this is critical - I grab data from different lookup databases to process regularly.
Scott