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.

New related records within a portal

Featured Replies

Hello all,

I've been wrestling with a problem I have with the generation of a new record within a portal. I use a script to show the related records within the portal, and if there are no related records present, the script creates a new record and presents me with what seems to be an empty portal awaiting my new record. The catch is that after I've input my data (or even if I don't input any data), and click outside the portal I always get one blank related record appearing at the top. I've tried go to first record, portal row, and can't seem to cause a new related record to be created without getting the bonus blank record. Can anyone shed some light on this? crazy.gif

Thanks for your help, Peter

I don't understand why you need a script to show related records in a portal. A portal does that all by itself. Futher I don't understand why you want to a script to create a new related record just because there isn't any. I use scripts to create new related records, but only when I need one.

You need to look at the relationship to see if it is set to allow creation of related records. Is there some sorting being done either in the relationship or in the portal?

Give us some more info to work on.

Just to ask a starting-point question from another angle: you've (1) enabled the "Allow creation of related records" option when you defined your relationship, and you've (2) tried just going ahead and (without a script) typing *directly into* the first blank portal row in order to create the related record? And what happens when you do that? Do you need to do more than that?

If you type into a blank portal (provided the relationship is defined to allow it), that's all you should need to do to create related record... Are we missing something about your situation here?

  • Author

Here's the deal, I have three tables,each related to the other with a match field "Category". The first table, Categories, consists of two fields:

"Category" and

"Constant".

I relate this table to it's self via the constant and place a portal on layout to provide a convenient list. This list is used as the basis for the relationship in the two other tables.

My second table is "Components" which has four fields:

"Category",

"Component",

"gCategory_Selection" &

"gVariables"

A portal is placed on this layout with another self-join relationship to show a list of related values using "Category" as the match field. "Component" is placed in the portal. The field "Category" is placed on the layout and set to not allow entry. "Category_Selection" is placed directly beneath and set as a pop up menu with values derived from the "Category" field in the Categories table.

Choosing a category from the "Category_Selection" field and clicking an adjacent button performs a script that enters find mode and pastes the "Category_Selection" into the category field, returning the related values. When I go to the components layout and want to create a new record (based on a "Category" as selected on the main layout) I choose a category as indicated above, all is well with the exception of the "extra" record that is generated within the portal.

The third table: Lets not go there for now.

I hope this makes sense (hhmmmmm) but the overall objective here is to enable the user to generate dynamic lists that are related to one another enabling the filtered information to be used elsewhere in the solution.

If you've any other approach, I'd love to hear it.

Thanks for looking and helping,

Peter tongue.gif

I have built a set of tables similar to what you described. I do not have your blank portal row problem. I did a GTRR rather than a find. I am attaching the file.

  • Author

Thanks Ralph, I'll pick this apart a bit later and get back with any questions I might have.

Peter

  • Author

Ralph,

Thank you again for your interest and help with this.

I finally had a chance to go through your solution to find that the "commit records" step was the one I left out and was giving me all the trouble. I changed my script to include this step and all worked fine. I've never used this step before, do you have any info on how and where this should be used?

Keep up the good work,

Peter yay.gifyay.gif

Commit Records is similar to the Exit Record/Request step available in previous versions. It is more vital, however, in version 7, because a record won't update without it even if you don't have the cursor in a field before running a script. It is also essential to use when setting a field that is used for a relationship that you want to reference elsewhere in a script.

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.