It should work the same as when you use a single step button.
GTRR is complex with a lot of options, "fails silently" when there are no related records to go to and throws up error messages but doesn't let you halt the script in others.
Feel free to describe your issue in more details so we can help you spot why it didn't work for you.
You may alsow want to read this thread to learn more about GTRR: The Complete Go To Related Record
Two files. Sales & Quoter In the Sales file the relation is; Quoter::Quoter_ID = Sales::Sales_ID and In the Quoter file the relation is the same.
In the quoter file I have a script that creates a record in Sales based on information in Quoter. In this script a set field step sets Sales::Sales_ID; Quoter::Quoter_ID.
So when using the single step button to gtrr, I specify to get related record from: Quoter using an external table's layout and I show only related records by matching the current record only.
However, when trying a script step to gtrr (only using a single step to test the script) and using exactly the same options in the single step button nothing happens.??????
In your script, add this step immediately after the GTRR step:
Show Custom dialog [ Get ( LastError ) ]
Then look up ErrorCodes in Filemaker help to see what error was returned.
If you look that up it means "record is missing" and in this context means that there are no related records to "go to".
I suggest posting an exact copy of your script. Then also tell us on what layout you are on when you perform this script and what table it specifies in "show records from" in Layout setup...
To post a script to the forum:
- You can upload a screen shot of your script
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
- 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 look to your script. (Use the HTML option and paste the text into the HTML editor.)