November 18, 200520 yr 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.
November 18, 200520 yr 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)]
November 18, 200520 yr 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.
November 19, 200520 yr 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
November 25, 200520 yr Author 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
Create an account or sign in to comment