What is the relationship you have for this portal? Is TUM_GEN listd in "show related records from" in portal setup?
What you have should bring up a found set of all the related portal records, but the portal record that was clicked should be shown as your current record. Does that happen? Will that work for you or do you need a found set of just that one record?
Once again thanks for the reply!.
The layout is based on PAT_GEN and the portal is a one to many daughter table. the portal shows records from the TUM_GEN table.
In this case each patient can have more than one tumour, at different stages of their diagnostic pathway. When the button is clicked i just want to go to the related portal row only. I am a little concerned that having multiple records available could confuse the end users, who are mostly IT illiterate and in a rush.
I suspect what i really need is a script that gets the kp of the portal row and then uses that as part of the script? Maybe i am making my life too hard?
An example filter is:
If ( TUM_GEN::CANCER_OR_SYMPTOMATIC_BREAST_REFERRAL_PATIENT_STATUS = "Suspected primary cancer" and TUM_GEN::ICHNT_REFERRAL_TYPE = "Breast Cancer" or TUM_GEN::ICHNT_REFERRAL_TYPE = "Exhibited Breast Symptoms (cancer not initially suspected)" ; 1; 0)
If (TUM_GEN::CANCER_OR_SYMPTOMATIC_BREAST_REFERRAL_PATIENT_STATUS = "Under investigation following a symptomatic referral, cancer not suspected (breast referral)" and TUM_GEN::ICHNT_REFERRAL_TYPE = "Breast Cancer"or TUM_GEN::ICHNT_REFERRAL_TYPE = "Exhibited Breast Symptoms (cancer not initially suspected)" ; 1; 0)
If (TUM_GEN::CANCER_OR_SYMPTOMATIC_BREAST_REFERRAL_PATIENT_STATUS = "Suspected recurrent cancer" and TUM_GEN::ICHNT_REFERRAL_TYPE = "Breast Cancer" or TUM_GEN::ICHNT_REFERRAL_TYPE = "Exhibited Breast Symptoms (cancer not initially suspected)" ; 1; 0)
I must assume from the previous post that Go to Related Records is working, but you have more records in your found set than you want as it appears you want a found set of just the selected portal record. You can easily do this by using perform script to perform a script that uses the GTRR step, but then adds a few more steps:
Go to Related Records [//use what you have currently specified]
Set Variable [$ID ; value: Tum_Gen::PrimaryKey ]
Enter Find Mode 
Set Field [Tum_Gen::PrimaryKey ; $ID]
Constrain Found Set
This filters down your found set to just the one record.
A star as always! I can also use that in the opposite direction.
I am still having some problems with this script....
I have set the script up as above but it is only going to the same record (the first row of the portal) whichever portal row I use. This isn't the result I was expecting.
In summary the simplest relationships go 1 to many, with other tables either 1 to 1 or 1 to many from each of these 3 tables as the datasets between tumour sites is so different. I have put thecore data for all tumours in the main tables then the tumour site specific in a 1 2 1 relationship hence needing to control which layout each tumour takes you to. it also confuses the end users when more than 1 related record is in the found set - which increases the likelyhood that data will be entered into the wrong record.
Patient ->Tumour ->Treatment
Unfortunately, this is affecting lots of scripts as there are lots of related daugter tables.
Please post the actual script that you are using unless this post points you to the culprit. Some step is causing the clicked portal record to "lose focus" before the Go to Related Records step performs. That will result in getting the first related record every time.
Another poster had this same issue. In their case, the script opened a new window before the Go To Related Records step executed and this will remove the focus from the clicked portal row. In their case, they were able to remove the new window script step and use the new window option that's part of go to related records to get their related records to appear in a new window as desired.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
- If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)
Go to Related Record [ From table: “TUM_GEN”; Using layout: “LGI Rectal Female” (TUM_GEN) ]
[ Show only related records ]
Set Variable [ $IDbst; Value:TUM_GEN::_kp_TUM_GEN ]
Enter Find Mode [ ]
Set Field [ TUM_GEN::_kp_TUM_GEN; $IDbst ]
Constrain Found Set [ ]
[ Maximize ]
Thanks - I bet it is something quite simple that is wrong!Brain is frazzled at the moment with this database.
How do you run that script? Is the button completely within the portal row boundaries?
Is TUM_GEN the exact text selected in "Show Related Records from" in the portal setup dialog for the portal?
Just had a look and the button is definately within the portal row on all the portals.
The tables are:
1 2 many TUM_GEN
1 2 1 TUM_GEN_CRC - this is for the colorectal subset
1 2 1 TUM_GEN_BST - this is for the breast subset
1 2 many DIAG_PATH_GEN
1 2 1 DIAG_PATH_GEN_BST- this is for the breast subset
1 2 1 DIAG_PATH_GEN_CRC - this is for the colorectal subset
1 2 many TRX_GEN
1 2 many FINAL_PATH_GEN
1 2 1 FINAL_PATH_GEN_BST
1 2 1 FINAL_PATH_GEN_CRC
I have used the convention _kp_TABLE NAME as the Key primary and _kf_PARENT TABLE throughout to make it easier to follow the relationships as there are about 80 tables including some that are used as value lists etc.
So, for example from the tumour (TUM_GEN) layout there is a portal showing the daughter records from the DIAG_PATH_GEN table; the portal is used to create the daughter records and then the button is there to either move to that daughter record within that window or as a new window depending on the context for that particular record and if it should be a pop up or not.
If your layout is based on TUM_GEN and the portal is based on DIAG_PATH_GEN, then your Go to related records step should be:
Go To Related Record [Show only related records; From table: DIAG_PATH_GEN; Using layout: "DIAG_PATH_GEN" (DIAG_PATH_GEN)]
Sorry, starting to confuse you as there are so many different scripts
[ No dialog ]
Go to Related Record [ From table: “DIAG_PATHOLOGY”; Using layout: “Diagnostic pathology breast” (DIAG_PATHOLOGY) ]
[ Show only related records; New window ]
Set Variable [ $DPID; Value:DIAG_PATHOLOGY::_kp_DIAG_PATHOLOGY ]
Enter Find Mode [ ]
Set Field [ DIAG_PATHOLOGY::_kp_DIAG_PATHOLOGY; $DPID ]
Constrain Found Set [ ]
[ Maximize ]
So this is the scrip to get you to the breast cancer diagnostic pathology layout - the others are based on the same script
I have included a couple of screen shots - one of the portal and one of the relationship graph
Remove the commit records step at the beginning of this script. This is the step that is causing the clicked portal row to lose focus.
Cheers that seems to be working now!
LOL - somethign so simple but yet so frustrating