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.

Add Record Button passing pk/name

Featured Replies

I have a layout where it shows a Person's information (name address etc), and it includes a Tab Control that lists all the dogs that are related to (owned by ) that particular person.

I want to be able to click on a button that allows the user to add a new dog that is connected to the person showing. I have a Dog Details layout, I just need to pass the person key/information to the Dog Details layout so the dog is automatically added to that person.

I've attached a screenshot of the Person Details layout with the Tab Control, and the Dog Details layout, where I'd like to have the Owner field automatically filled in when added a new dog.

In my button control, I've tried a Single Step and the Go To Layout, and adding the Optional Script Paramater, using the Primary Key from the People Table, but it doesn't seem to be working.

I'm very new at this and I'm sure there is an easy solution for those experienced users.

Thanks!

Cynthia

 

Screen Shot 2017-06-13 at 2.22.21 PM.png

Screen Shot 2017-06-13 at 2.22.37 PM.png

Edited by Cynthia Heyman

  • Author

Thanks I'll read that over.

I've been able to pass the record to the Dog Details Layout... but it passes everything, and I only want the Person passed, not the dog information.  

 

Screen Shot 2017-06-13 at 3.29.10 PM.png

Screen Shot 2017-06-13 at 3.29.28 PM.png

56 minutes ago, Cynthia Heyman said:

I've tried a Single Step

Try a script. Something like:

Set Variable [$ownerID ; Value: Owners:OwnerID ]
Go to Layout [ Dogs ]
New Record
Set Field [ Dogs::OwnerID ; $ownerID ]

If you prefer, you can pass Owners::Owner as the script parameter, and shorten the script to:

Go to Layout [ Dogs ]
New Record
Set Field [ Dogs::OwnerID ; Get (ScriptParameter) ]

 

 

 

  • Author
9 minutes ago, comment said:

Try a script. Something like:


Set Variable [$ownerID ; Value: Owners:OwnerID ]
Go to Layout [ Dogs ]
New Record
Set Field [ Dogs::OwnerID ; $ownerID ]

If you prefer, you can pass Owners::Owner as the script parameter, and shorten the script to:


Go to Layout [ Dogs ]
New Record
Set Field [ Dogs::OwnerID ; Get (ScriptParameter) ]

 

 

1

Filemaker doesn't let me type in the last line of your code....

Set Field [ Dogs::OwnerID ; Get {ScriptParameter) ]

It seems to delete it when I click off the text... how can I get it to keep the text? I'm assuming it's not letting me because it's not a premade script item.

 

The Set Field [] script step has two parts (click the wheel icon to see them):

  • In the 'Specify target field' part, select the field used by the Dogs table as the foreign key in the relationship to the Owners table. In my example, that's Dogs::OwnerID - your table/field names may be different;
  • In the 'Calculated result' part, type:
Get (ScriptParameter)

or insert the function by double-clicking it in the functions pane.

 

Edited by comment

  • Author

Thanks for your reply, and that works! :)  I really appreciate it.

Just read over the new Card feature in Filemaker 16... and maybe I'll see if I can get that to work instead, I like that idea. 

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.