3 Replies Latest reply on Jan 10, 2011 2:10 PM by philmodjunk

    Modifying "check-out" process script in "Lending Library" Starter Solution

    DanielPostilnik

      Title

      Modifying "check-out" process script in "Lending Library" Starter Solution

      Post

      The Lending Library template first seemed like a great solution for my equipment rental business. However, there's one thing I would like to change. By default, when I'm looking at an asset record and I click "check out", the script grabs the current date and time as the date and time for checkout. This would make sense if I only did this when the gear left the shop, but I wanted to use this database to help me keep track of reservations so I can avoid double booking.

      I know this would change the intended functionality of this database, but I want the "check-in" and "check-out" process scripts to prompt me for the checkin/checkout date and time. How would I accomplish this?

        • 1. Re: Modifying "check-out" process script in "Lending Library" Starter Solution
          philmodjunk

          Apologies in advance, but instead of giving you a detailed description of what to do, I'm going to take an approach that challenges you to figure out for yourself how this starter solution works. That way, you'll get a decent working knowledge of how it is designed and thus be able to figure out how to make other changes besides this one on your own.

          FileMaker might enter the current date and time as an auto-enter field option or it might be a step in a script. You need to figure out which method was used and then you can disable that option and use a script with a Show Custom Dialog (Or even a floating window created with New Window if we get fancy here) that captures the date and time.

          Another thing to check will be if date and time are being recorded in a single field (field is of type TimeStamp) or two fields, one for time and one for date.

          You can check Field Options by Opening Manage | Database | Fields. You can check for scripts by entering layout mode and double clicking any button you click just before the current date and time is logged to check in/out an item. This pops up a dialog for the button's script and you can then use Script Manager to open up the script and examine it. (In FileMaker 11, it's possible to click the specify button then select edit from the "gear" drop down to open the script directly.)

          • 2. Re: Modifying "check-out" process script in "Lending Library" Starter Solution
            DanielPostilnik

            Phil, I found the script where the current date is pulled. It uses a set field function to record the current date (pulled with the function Get(CurrentDate)) into a "history" table that tracks past check-outs. I think set field is still the right function to use, I just want it to trigger a dialog box that prompts the user for a date and time, and I'm not familiar enough with the various script paramaters to do this yet, or even where to start looking. Some guidance would be helpful, thanks.

            • 3. Re: Modifying "check-out" process script in "Lending Library" Starter Solution
              philmodjunk

              Open Manage | Database | Fields and define a new field, gDateReserved of type date. Click the options button, click storage tab and specify global storage.

              You'll add script steps like this to the script where you found the set field step:

              Show Custom Dialog["Please enter the date"]

              With this show custom dialog, select the Input Fields option and specify gDateReserved as the field that's used with this "input field".

              Next steps in your script:

              If [IsValid (History::gDateReserved) ]
                 Set Field [History::datefield ; history::gDateReserved]
              End IF

              You'll need to insert this in place of your single set field step that inserts the current date.