Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6940 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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)]

Posted

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.

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.