Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now