?
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
?
369 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
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…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

850 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