Jump 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.

Mastering "Perform Find" ?

Featured Replies

Hi,

I've come across this problem a few times and hope someone might have been down this track before me!

This is what I'm trying to do;

I have 3 layouts - "Person", "Car" and "Events". One "Car" record can have many "Events" reocrds. When I look at one "Events record" I would like to have a script that finds ALL "Events records" for the related "Car record". These "Events" records would have the same 1st field/value (ID) but other fields would have unique values.

So I've made a script that does this (keep in mind that I'm a newbie at FM7 :-)

Go To Layout [Events]

Go To Field[select/Perform, Events::ID]

PerformFind[]

SortRecords[]

But how do I specify the search criteria? I can't specify it in PerformFind that I want all records that have the same ID!?

Don't know if there is simpler way to do this?!

Kind Regards

Andrew Carruthers

There are several ways:

If you want to go thru Find, you need to "remember" the CarID somewhere, so that you can use it in your find request in Events. You could use a global field for this, but it is simpler to define CarID as the script parameter in the button calling the script. Then:

Go To Layout [Events]

Enter Find Mode []

Set Field [ Events::CarID ; Get ( ScriptParameter ) ]

PerformFind[]

But, since you already have a relationship between the Car record and its related Events, the simplest way is:

Go to Related Record [ From table: "Events"; Using layout: "Events" (Events) ] [ Show only related records ]

  • Author

Hi Comment,

thanks for your help!

Hope you can help me some more bucause I can't seem to make it work. What happens is that ALL the Event records turn up which is not what I want. frown.gif

Maybe I didn't explain the relations enough?!

I have the same field-type; ID in Car layout and Event layout, but for one car record there can be more than one Event record. I have an "=" relation between the Car and Event layouts. Hope this input can help you in helping me smile.gif

Once again, thanks for your time and help!

Kind Regards

Andrew

In ScriptMaker, when you select the Go to Related Record [] step, examine carefully all the options. One of them is "Show only related records". Make sure it is checked.

The other thing to check: if you have more than one occurence of the Events table in the relationship graph, make sure you select the correct TO, i.e. the one that is connected to Cars via CarID.

  • Author

Hi Comment,

Thanks for your answer, I've been away for a few days and not been able to read this great homepage wink.gif

I've followed your advice and done just this. The "GoToReleatedRecord" is ticket with the "Show only related records" option and the relation I've setup in "define Database" has one link of type '=' between both ID's in each layout.

Still I get all records from the EventData layout.

Is there any other way around this problem or should this work?

Thanks for your help,

Best Regards

ANdrew

This should work. Can you post your file?

  • Author

Hi Comment

Posting my file, hope this can help you see what I'm doing wrong wink.gif

Thanks for your help!

Best Regards

Andrew

version3.zip

OK. We had a little misunderstanding. I thought you would be in the Car layout when asking to see the events related to THIS car. It turns out you want to be on some event in the Events layout, then asking to see all events that are ALSO related to the same car. Since there is no relationship between events, the thing to do is a quick hop to the related mama car, and go to related events from there.

I have also added the option to do the same from the car layout, and a portal. Delete whatever you don't need.

version3.fp7.zip

  • Author

You are a star - Thanks a lot !

Best Regards

Andrew

Create an account or sign in to comment

Important Information

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

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.