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.

Featured Replies

I have a portal that contains 3 fields. two standard text fields and one field that is a check box for "yes/no". This too is a text field, it's just based on a value list [Yes:No]. The portal itself is based on a self join relationship of a calculated field. No biggie all is displayed well.

The goal is to be able to loop through the portal and find the first record with the radio button checked Yes, then grab the text from one of the above mentioned text boxes of the same record and copy it onto the current or master record (the one containing the portal).

I'm not sure how to do this, although my gut feeling is that I will need to do some sort of loop on the related records and not really use the "go to portal row" script step. What I'm having trouble with is, looping through all the related records find the the first "yes" one and then copy the data back to the original record text field. I hope this isn't too confusing, I think it's probably not too hard, I just get confused on the navigation.

The information doesn't exist in the portal, it exist in the child file. You will to do your search in that file.

  • Author

By child file I guess you mean, the referred to record? That is, the record from which the portal data comes from. Not sure of the correct terminolgy, but I think I know what you are saying. I think having the existance of the "go to portal row" got me thinking there may be an easier way, as I am having difficulties organizing the script.

Hi Paul,

Sorry, I usually only use FileMakers terms for relationships, but didn't in this case. You are correct. The related record is the same as Child.

In any event, the portal is only a way to see this information in the related file, but it really only exists in the related file,

HTH

Lee

Hi Paul

If you only need the first result in your portal with a "yes" result then the simple solution would be as follows:

Create another relationship exactly the same as the one used for your portal - but sort it by the yesno field (descending). Well call this relationship R2

Now, lets call your existing text fields as text1 and text2 and the fields you want to copy to on the layout with the portal we will call master1 and master2.

Now your script must: SetField [master1,R2::text1] and SetField [master2,R2::text2]

That is all you need to do, because of your sort order in the relationship the record with the first yes will be referred to.

Pete

Hi Pete,

I finally see some good stars here under your name grin.gif

Yes, this is actually a good one.

In addition to what Pete just said, using the sorted relationship, you may have 2 other options.

1.lookup fields from the related file

2. simple related fields

Now if one day you want a list of all first records being tag with a Yes in the related file, use this method.

In the related file, create :

1. a global field g_yes (obviously text with "yes")

2. a concanateglobal = g_yes & " " & Foreign Key

3. a concanateindex = yes/no & " " & Foreign Key

4. A selfjoin concanateglobal::concanateindex

5. a calculation = Case(Record_ID = Selfjoin::Record_ID,1,0)

This will tag any first yes record related to the Main file (using the Foreign Id).

As this is an unsorted calculation, you cannot use it directly with a Go To Related Record, but you can make a find on it or again sort your relationship based on this calculation.

  • Author

Excellent idea! I'm going to try this out, and I will let you know how it goes. Thanks a lot!!

  • Author

Wow, that worked like a charm, thanks a bunch Peter. I didn't even know about the sorting option for relationships. Ugo, I deffinetly forsee an upgrade like you have mentioned. This Forum rocks!

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.