Solved

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

Posted on 2006-10-23
2
360 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 500 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Filemaker Display Images 1 269
FM GO Web Viewers 1 220
FileMaker 12 - Restrict users to see only their own records 2 1,497
Error during copy and paste 3 110
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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