Jump to content
Sign in to follow this  
apinrise

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

It is a calculation field with a container result:

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


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

  • Thanks 1

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
  • Thanks 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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