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.

multiple portals - record creation issue

Featured Replies

Hello

I have a layout which has 2 portals on it. The first portal is the child of the overall layout table and the second portal is the child of the first portal.

The database record creation configuration is set to match this: the overall layout table has record creation ability in the first portal and the first portal has record creation ability in the second portal.

The problem I am having is when I add a record the second portal, a record automatically gets inserted in in the first portal--its parent. However, this should not be happening since the child has no ability to create records in its parent.

I can separate the portal tables on different layouts, but would rather keep everything on one layout.

Any ideas?

Edited by Guest

That's how it's supposed to work. Because the relationship from parent to grandchild goes through the child, you cannot create a new grandchild from parent without having a child in-between. It's a matter of relationships, not of portals.

If you want to create orphaned grandchildren from a parent layout, you will need to establish a new relationship between the parent and the grandchild directly.

Edited by Guest
Added clarification

  • Author

Thanks - I don't want to modify that relationship so I'll create a new layout.

I didn't say you need to modify the existing relationship - I said you need to create another one. I am not too sure what's your purpose here, so I don't see how a new layout would help.

  • Author

A new layout is not what I am looking for, however, I just tried adding a new relationship between the grandparent and the grandchild (parent -> child) with the existing relationships between all 3 intact. In doing so, I created a new instance of the grandchild table, however that did not work.

[color:purple]In FileMaker, there are typically several different ways of doing the same thing. Although a relationship is one way of handling your situation, you can also make an end-run around all of this by making changes/additions to the table script- and button-driven. I use scripts in the background all the time, although the databases I work on are usually quite complex and often the number of changes needed can't be handled by a relationship alone.

In your case, I don't have enough time to analyze your tables for you, but it sounds like something so simple should be handled by relationships. And making a new layout isn't that big of a deal unless you're talking about copying everything on the other layout over, with most of the fields coming from a different table.

If you're talking about reworking a complicated layout, you might want to evaluate whether the new layout alone is a better choice, or a layout-script combo would serve your purposes better (meaning the new layout is simpler, and the script just goes there and makes the changes in the background).

Which is best is a matter of experience. After you've been programming for years, you'll know instinctively which is most efficient, user-friendly, and best suited to handle modifications going forward. Until then, it'll be a good learning experience.

???

I created a new instance of the grandchild table, however that did not work.

"Did not work" is not a good description of a problem. And we still don't know what is the purpose behind this.

  • Author

The layout is not that complicated, however, I would like to keep things on one layout.

But because I do not have much time and I have yet to figure out what the issue is, I may go with putting the other portal on another page.

  • Author

I added a second relationship from the grandparent to the grandchild. This created a new instance of the grandchild table.

When I go to the layout and display the original instance of the child table, nothing has changed--when I create a new record in the grandchild table, a new record also gets created in the intermediary table.

When I display the second instance of the child table on the layout (the one with the relationship to the grandparent), the first record in the grandchild table is displayed multiple times and no other records show up. I also cannot create any new records in the grandchild table either.

This is very hard to follow, but it looks like the fields in your new portal (to the second occurrence of the grandchild table) come from the FIRST occurrence of the same table.

  • Author

Yes-you are correct. However, it is only displaying the first record and no others (there are about 6 other records).

Again, I don't follow. You need to change the fields in the new portal to point at the correct TO - did you do this?

Another thing that's not clear is what is the direct relationship between parent and grandchild based on? Perhaps you should attach your file, and explain what exactly are you trying to accomplish with this structure.

  • Author

That was it--I had changed the portal to reflect the second instance of the table, but did not change the individual fields to reflect the second instance of the table. Thank you..

One quick question: when you have two instances of a table, I'm assuming that the actual data is the same between both instances?

Yes (except the correct term is table occurrence, not instance). See also:

http://www.fmforums.com/forum/showpost.php?post/296774/

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.