Jump to content

Script trigger to find record


This topic is 5550 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

This topic is 5550 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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