cmartin Posted February 11, 2003 Posted February 11, 2003 I hope my icon expresses frustration! I have a file with a bunch of self-relates. When you are in the current record, there is also a portal below which lists other records from the file that are related. If a row in the portal is clicked, then this should become the current record. I set it up by: Set Field(gSelectedRecord,Portal Rlnship::Record ID) Go to Related Record(Show,"Current Record") where Current Record was defined as gSelectedRecord = Record ID. When clicking the row, sometimes this would work and sometimes it wouldn't. After much troubleshooting, I realized that if I inserted Go to Next Field in between the two lines of code above, it always worked. Does anyone know why this is necessary?!?!?!? I am stumped...doesn't seem right. fyi...while troubleshooting, I separated the GTRR out into a button and on some records, the button would need to be clicked twice in order to work. WTF?
Ugo DI LUCA Posted February 11, 2003 Posted February 11, 2003 Set Field(gSelectedRecord,Portal Rlnship::Record ID) Go to Related Record(Show,"Current Record") where Current Record was defined as gSelectedRecord = Record ID. It can get sometimes confusing when working with Portals in the same file. You must make sure what is the "source" file and the "target" file. If your self relationship is set in the Main file (where the Portal is) as Main:g_SelectedRecord::Selfrelation:Record_ID Then, try to create a 2 lines simple script Goto related record (selfrelation::Record_ID) Goto Layout# If what you are trying to do is "highlight" this row using the traditional calc c_Highlight = Case(g_selectedrecord = Record_ID, Container1, ""), then you should have a script set as : Goto related record (selfrelation::Record_ID) Setfield (::g_selectedrecord,Record_ID)
Kurt Knippel Posted February 11, 2003 Posted February 11, 2003 One thing that you also need to keep in mind is the screen refresh. Filemaker (or any app) cannot always know when to refresh the screen, and this could be what is happening, you are going to the related record, but the screen is not refreshing. The Goto Next Field function causes a screen refresh. Generally in self relationships where I am moving between records, I will include the Exit Record step, which also causes a screen refresh.
cmartin Posted February 11, 2003 Author Posted February 11, 2003 Hey captkurt - you are right, I tried exit record in place of go to next field and that worked as well. Curiously, I had considered the refresh issue while troubleshooting and originally tried Refresh Window in place of Go to Next Field and that did not work. Anyway, it works now and for that I am thankful, just wish I understood a bit more about why. Thanks! Courtney
Recommended Posts
This topic is 8025 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now