?
Solved

Use script to open layout to take new record inserting primary key information in the layout.

Posted on 2006-10-23
2
Medium Priority
?
363 Views
Last Modified: 2010-04-27
I am trying to develop a script to create a related new record in a layout (Employer) and automatically insert primary key field information from layout (Contact) into a foreign key field in the new record in the Employer layout. This is a very common step in other databases such as Access so I am sure there is a simple method or example of how to do this in Filemaker Pro to which I am a relative newcomer. I experimented with:

Go to Layout ["Employment"(Employment)]
New Record/Request
Set Field .....its is here that I am failing to get the fields matched up. What do I put
Commit Record/Requests [No Dialog]

I can see me using this step all the time throughout my databases so any suggestions would be appreciated.
0
Comment
Question by:c0link
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
lesouef earned 2000 total points
ID: 17795607
You can either enable related records creation through the relationship (see relationship properties, or store the employeeID in a variable and use that to define the key in the sub table

Define variable [$id = ContactID]
Go to Layout ["Employment"(Employment)]
New Record/Request
Set Field [Employment:contactID ; $id]
Commit Record/Requests [No Dialog]
0
 

Author Comment

by:c0link
ID: 17800524
That's great, I knew there was simple means to do this. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question