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

Opening an object with a portal row

Featured Replies

Hi,

 

I am struggling to achieve what I thought would be a simple button script.

 

 

My company table's layout has a portal showing the related personnel through the field - "company_id" in the personnel table. It also has a popover with a second portal which I use to enter the details of the personnel for that company record.

 

I would like the popover, when I open it through the popover button, to go to a new personnel record.

I would also like  the "edit personnel" button, which is positioned on each row, to open the same popover but go to that portal row.

 

 

At first I had the popover open with a filter on the portal for If [isEmpty (Personnel::First)] which, although ugly, achieved what I wanted. But I think I have to remove that in order to get the edit personnel button to work. So now i'm not sure how to even get the popover to open with the portal aiming at a new record.

 

For the edit personnel button I tried a few methods. My most recent attempt was -

 

Set Variable [$row; Value: Get (ActivePortalRowNumber)]

Go to Object [Object Name: "Add New Personnel Portal"]

Go to Portal Row [No dialog; $row]

 

Which obviously didn't work or I wouldn't be here. :)

 

Any help would be greatly appreciated.

 

Thanks

"My company table's layout has a portal showing the related personnel through the field - "company_id" in the personnel table. It also has a popover with a second portal which I use to enter the details of the personnel for that company record."

 

You cannot have a portal within a portal. So, if you have a popover button in a portal row, that popover cannot contain a portal.

 

Not clear as to why the related fields for the personnel record require a portal. To me, I would have an Add button (could be a popover) above the portal, and an edit button, also a popover, that shows the related employee fields. Don't use the same popover for both.

See here for an example (which, actually, uses just one popover …).

 

This could do with some fine-tuning – e.g. adding Cancel and Save/Create buttons to the popover, depending on edit mode, etc. – but it should get you going.

EditSelectedOrNew_eos.fmp12.zip

  • Author

Thanks for the replies.

 

I didn't explain myself properly - I mean't to say that I had a popover on the layout, not in the portal itself. In fact I didn't know you could have a popover in a portal; filemaker is ace :D.

 

To me, I would have an Add button (could be a popover) above the portal, and an edit button, also a popover, that shows the related employee fields

 

How do you get a popover to show related employee fields without a portal? Thanks

edit - ignore - long day, misread your statement.

 

Eos,

Thanks I've had a brief glance and I think i can pretty much apply this to my own database. However, I see the staff_create portal off to the side. I dont understand how it automatically positions itself within the popover though.

Hi eos

See here for an example (which, actually, uses just one popover 

That’s a nice example you provided, and should be helpful to others in the future.

 

This has actually became one of my favorite features in 13.

Edited by Lee Smith
favorite features

I've had a brief glance […] I dont understand how it automatically positions itself within the popover though.

 

Maybe take a longer glance …  :laugh:

 

There is no automatic positioning going on; the portal in the popover does not display records from staff_create, but rather is a one-row version of the visible staff portal, filtered with the selectedStaff field.

  • Author

Hi Eos,

Thanks for that - works great and I can use the same method for other parts of the database.

 

:)

  • 2 months later...

You cannot have a portal within a portal. So, if you have a popover button in a portal row, that popover cannot contain a portal.

Oh - I've just started to do this and it seems to work fine.

Is this new to V13, or am I blindly walking into a whole new world of chaos?!!

Many thanks - as far as I could tell, it did work OK, but it wasn't hard to move it alongside the initial portal rather than inside it.

I'm not really sure why I didn't do that in the first place really!!

 

Cheers :-)

 

Mike

To clarify, you CAN have a popover button in a portal row. This is a nice UI for editing portal rows. Just show the related record in the popover.

 

You cannot have a popover button that contains a portal in a portal row (or a popover that has a slide panel). That would be a portal in a portal. What you do when you need this functionality is to "fake" it. Have a button in the portal row that opens the popover that has a portal. This popover sits outside of the portal. Drive the data you show in the popover portal by setting a global field.

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.