Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
368 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

636 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