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.

fk of join table won't connect but 'go to related' script does

Featured Replies

I have a table Exhibitions for photographic prints. Sometimes we only know the unique number of the Image in the print, other times we know the Image No. and the Print No., and some times we only know the Print No.. (Images have multiple prints, prints only come from a single Image.)

We have a join table to connect Exhibitions with Prints and also with Images. There are two fields in our join table fk_PrintNo and fk_ImageNo.

When there is a PrintNo. value in the portal row, the c_Thumb field of the join table gets the thumbnail from the Print record, and if there isn't a PrintID but there is an ImageID, the c_Thumb field gets the thumbnail from the Image record.

However, it only gets the Print thumbnail if there's ALSO a value in the Image field. Even when I test by putting the Print record ID field in the portal layout it only shows up if there's also a value in the Image fk field. (See screenshot below.)

I've also attached the ERD.

 

Screen Shot 2019-01-21 at 7.27.11 PM.png

Screen Shot 2019-01-21 at 7.27.30 PM.png

In the layout screenshot above, Ref JPEG is the Image No., and the row with the Image header is what I replaced with the Print No. to see if the join field was bringing in any of the data from its related record...which you can see it isn't until Image No. has a value and connects to its related record.

 

And just to add, when I'm looking at the Prints layout, I do see the correct Exhibition information (even if there isn't an Image No.)

Edited by apinrise

I am having trouble connecting what you describe to the screenshots. Anyway, let's start with the obvious question: how exactly is the c_Thumb field defined?

  • Author

It is a calculation field with a container result:

If ( printsVIAexhib::Print Thumbnail ; printsVIAexhib::Print Thumbnail ; originalVIAexhib::Original Thumbnail )

That should work, and since it does not reference the Image fk field, it should not depend on it having a value. So there's something wrong with your setup that's not mentioned in your description, because you are not aware of it.

Check that the layout belongs to the correct TO; that the portal points to the correct TO; that all the fields in the portal are fields from the correct TOs; and that the TOs on your relationships graph are TOs of the correct base tables.

  • Author

Hmm. The Exhibitions layout is correct, and the portal is the join table, and each of the fk fields point to their respective related tables. I've checked that the connecting fields are of the same type (all Text fields).

Any clues on what else it could be?

No. Could you post a copy of your file - preferably after removing everything that's not relevant to the problem?

  • Author

Yes, let me know if you need more than this:

dbtest.fmp12

20 hours ago, apinrise said:

it only gets the Print thumbnail if there's ALSO a value in the Image field.

Does this answer your question:

image.png.0ad3b1fffadea6f67bdb51b96e7c714f.png

  • Author

Ohhh I was SO hoping that was it, but after removing the "Hide object when" value it still appears blank. Did it work for you?

5 minutes ago, apinrise said:

Did it work for you?

AFAICT, yes. Am I missing something?

dbtest2.fmp12

  • Author

You're right...in the file I sent you it does now work. I don't understand what the difference would be. The original with all the records is set-up the exact same way, I just removed the extra records and created a few fake ones for you to test--but the names are the same so I'm not sure why one would work but not the other...

It did not work in the file you sent, until I removed the hide condition. If you have a file where it still doesn't work after removing the condition, then let us see it. One record is all we need.

Edited by comment

  • Author

Okay I figured it out but I'm now concerned about a more significant glitch: 

The field for c_Img in my original file didn't show having a value for "Hide object when" (for me) and neither did the ">go to original" link, yet both of them were disappearing from the portal when the now-invisible value returned true. I deleted the ">go to original" link object and added it again and now it shows! Same with c_img! It's as though the "Hide object when" attribute was stuck with the original value even though it was showing as removed.

Edited by apinrise

Looking at the posted file again, it appears the  c_Img field is grouped with some other object. The hide condition appears only after you click again to select the field within the group. Did you try to make it a button at some point, then change the button to do nothing? I believe that would explain it.

  • Author

That could be. I'll keep that in mind the next time something like this occurs. Thank you so much for thinking through this with me. I doubt I could have resolved it without the input.

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.