Mitch in Halifax Posted November 18, 2005 Posted November 18, 2005 I have a dispatch solution where a selected driver picks up a member passanger and takes them to a destination. Members and Drivers have dedicated tables. A trip table reflects driver name and passanger name, pick up location, pick-up time, travel distance and charge. New trip record allows for passanger and driver fields input from drop down lists. What I am trying to accomplish is that once a name is selected a script will run that goes to the member file picks up the member ID and then paste it into the fk_membersID field. I have tried to get the data into the field via a portal but can't get it to work so I thought that using a script would be OK.
Breezer Posted November 18, 2005 Posted November 18, 2005 Try using the function "Get (ScriptParameter)" In the "Member File", create a scripted button where you define the optional script parameter, click on edit, then select your primary key, thus, MemberFile::MemberID will appear as the parameter. In your related file, say, Set Field [fk_membersID = Get (ScripParameter)] Your script would look something like this and should be called from your MemberFile: Go to Layout[Trips] New Record Set Field [fk_membersID = Get (ScripParameter)]
BrentHedden Posted November 18, 2005 Posted November 18, 2005 Just as a side note - If you're using (or will be) FileMaker Pro 8 Advanced, you can use script variables for this job as well. I do it all the time and works great. What Breezer has suggested works great with either 7 or 8.
T-Square Posted November 19, 2005 Posted November 19, 2005 I have tried to get the data into the field via a portal but can't get it to work Have you checked that your relationship allows creation of records? The portal approach is simpler to implement and maintain. Or you create a Trip layout that includes dropdowns for Driver and Member that use value lists for the respective data files... David
Mitch in Halifax Posted November 25, 2005 Author Posted November 25, 2005 I don't yet understand scripting steps that well. I created the button as you suggested but when I attempt to create the script in the scripts menu I get nowhere. I would appreciate a bit more guidance. Thank you very much for your help Mitch
Recommended Posts
This topic is 6940 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now