Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script trigger to find record

Featured Replies

I hope this is in the correct forum. I am new to FM Pro.

I am building a relational database, and in one layout I have a portal showing the document records related to a client ID number.

The portal can show up to ten document records, and each document record in the portal begins with a field showing the unique document ID number.

I would like to define a script where, in browse mode, the user clicks on the document ID field in the portal and the script finds that record number.

I presume that I can use an 'OnObjectEnter' script trigger for this, but cannot work out how the script can read the unique ID number contained in the field that is being clicked on.

Anyone offer any help?

Have you tried GTRR "Go To Related Record" script step? You can just set the DocumentID field as a button with the GTRR and it will take the user there.

hth

In other words, you don't need a script trigger to do this, since a user click on an object defined as a button will run the script assigned in the Button Setup... dialog.

Just right click on your ID field, select Button Setup... and assign a Go to Related Records script step, with a specified relationship and target layout.

  • Author

Thanks. That's great. I have managed to define the field as a button, but I am stuck on the Go To Related Record Script. Perhaps I need to read more - I have tried the Filemaker help - but I would really appreciate a little more explanation on the script.

See if this helps. Look at the button setup and then click specify.

If you still have questions let us know.

GTRR_Test.zip

  • Author

Hi Aldipalo

Thanks very much indeed for taking the time and trouble to produce such a clear example. I can now see exactly how it works. As a result, I have identified some problems in my own work: firstly, I had specified 'text' rather than 'number' for the serial and ID numbers, thinking that I didn't want to do calculations with them so they must be text.

I still can't get my own Dbase to work like your example, so I still need to find out where I have gone wrong. But now I can see how it 'should' work, I've got a good lead.

First, I would suggest you do a little reading before getting to deep in to your database design. Poor structure has a way of coming back and kicking you. Go here:

http://www.foundationdbs.com/downloads.html

and read 'White Paper for beginners and database design.' They are 2 well written articles that will help you tremendously.

Second, if you'd like, post a clone of your file with a few bogus records and we'll take a look at it for you.

  • Author

Once again, thank you most warmly. I will read the two documents suggested, make any changes that I think need to be made to the database as a result of that learning, then, if I may, I will take you up on your offer and post a clone of the db for your comment.

KB

  • Author

I have read the two papers, and have made a number of changes as a result. Here is a clone of the database and I would be most grateful for any comments and/or suggestions. Attachment in private topic.

KB

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.