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

Creating a related record without using a portal

Featured Replies

I'd like to create a script that creates a new related record in a different layout. Is there a way to do this without using a portal? I tried creating a script that copy/pasted the related field, however I saw that this is not a good idea because it pollutes the user's clipboard. I also had trouble getting this to work because my script kept selecting-all, instead of just the contents of the field in question. Am I missing something?

Any advice would be really appreciated.

Try using the Set Field[] script step to set one of the related fields. The related field need not be on the current layout.

I often use the Set Field approach but there are a couple of drawbacks. First, creating related records this way can be slow. With one or a couple of related records, you want notice but watch out if you are creating hundreds in a looping script. Secondly, you have to jump through some hoops if you want to create a related record for a parent that currently has children.

I often use the following approach:

Go to Layout ["ChildLayout" (CHILDTABLE)]

New Record/Request

Set Field [ForeignKey; Get(ScriptParameter)]

Go to Layout [original layout]

Don't forget to assign the options script parameter to the button that runs this script so you can pass the primary key from the parent record to the script.

Each technique has it's advantages and disadvantages. I've listed some of the disadvantages of Set Field but it does have the advantage of not requiring a layout. What if you decide to delete this layout? Well, the script parameter method won't work any longer because it is dependant on this layout. I like to keep layouts and scripts independent of each other whenever possible but not at the expense of speed or complexity.

My suggestion is to learn both approaches so you can use each one at the right time. I even have an example file showing the Set Field, Script Parameter approach as well as an additional approach.

http://www.filemakerpros.com/NEWROW.zip

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.