Portal Setup Basics - File Maker

Now let’s set up the way a portal to related records functions. Go back into Layout mode on the Contacts tab of Company.fp5. Double-click the gridlike Contact by CompanyID portal and you’ll see the Portal Setup dialog:

Portal Setup Basics

Portal Setup Dialog
Here you can specify which relationship to use in the “Show records from” dropdown menu. If the “Allow deletion of portal records” is checked, users will be able to highlight a portal row and delete the related record.

Entering a value in “Show n rows” specifies how many related records will appear in the portal on the layout (but not how many related records there can be, which is virtually infinite), as well as how much vertical space the portal will take up on a layout. Checking the “Show vertical scroll bar” box will add a scroll bar at the right of the portal so you can scroll up and down through all related records, regardless of whether they surpass the number of rows in the “Show n rows” field.

If you check “Alternate background with” and then select a color and pattern, you set the appearance of every other row in a portal. This is handy in large portals because it makes each portal row easier to read. Remember, though, that any color specified here will print on a print layout and that the color and pattern selected here are the alternate color of any color or pattern specified on the portal object itself in Layout mode.

Cancel out of this dialog, and note that in order to show related data in a portal, you’ve got to arrange the related fields over the top of the portal on the layout, not under it. Use the field tool to drag a new field to your desired position on the layout and specify the field using the same relationship as the portal (or you’ll get very strange results). Here, you’ve already got the cFullName, Title, Phone, and Email fields.

You only need to put related fields on the first visible portal row. In the other modes, whatever you put in the first row will replicate automatically on all other visible rows. You can put buttons, lines, or other objects on the first portal row, too, and they’ll also be replicated on every portal row. Vertical lines can be drawn across the whole portal, crossing all rows, to add a nice divider between fields in the portal.

When You Don’t Need a Portal
Go into browse mode and click the first contact of record #2 in this database, which should be Chris Kubica (though any contact from any company will do). A script runs and takes you to the contact you clicked in the Contact.fp5 database. You’re now looking at the detailed information for that contact.

Now go into Layout mode on the General Info tab of Contact.fp5. Note that there are several local fields at the top (first name, last name, and so on) and several related fields in the middle (marked by the :: at the start, such as ::bCompanyName) that are not in a portal. Why are these related fields not in a portal? Well, related fields don’t have to be in a portal and usually are not when you’re showing related data in a many-to-one relationship. There is only one company for this contact, whereas there were many contacts for this contact’s company (thus the portal back on the Contacts tab of Company.fp5).

Here, all these fields show the related company information for this contact. This information does not need to be stored here in the contacts database because it would be redundant. This makes sense, because if you change the information for a company, like its main phone number, you would like that information to automatically update for all of its contacts, rather than have to update each contact manually. Now, of course, if contacts in your world usually have their own phone numbers other than the main company line, you would also give them a LocalPhoneNumber field in Contacts.fp5 (as you have here).

All of the grayish, non-editable company-related fields here are for a user’s reference only. You could allow editing, but if a user edited the local company phone number from here, they could be unwittingly editing the master company phone number for all the company’s contacts by mistake. So be careful when granting access to non–portal related fields on a layout.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

File Maker Topics