2 Replies Latest reply on Feb 24, 2012 8:07 AM by CharlesEllis

    Entering a variable from a layout which will be placed in a field from a script

    CharlesEllis

      Title

      Entering a variable from a layout which will be placed in a field from a script

      Post

      I am a little new to Filemaker, and have generated a non-profit database for keeping up with payments. Anyway, the problem I am having is when I want to generate a group of records based off of exisiting records - I can generate them just fine, but I want to add a date to the records from one entered in a layout.  I am having a problem with finding a way to have an input box on a layout into which I would enter a date, I then have a button I click on which runs a script to generate the records into which I want to place the date entered in the layout replacing the date in the generated records.  Hope this makes sense...  I want a variable on a layout which I can use in a script to add to a field in multiple records. 

        • 1. Re: Entering a variable from a layout which will be placed in a field from a script
          philmodjunk

          You can define a date field with global storage specified in field options to serve for your edit box. you can even specify a pop up calendar for it to make picking dates easier.

          I'm not sure if you then want to find existing records to update with this date or to create a set of new records with this date, but both can then be done.

          Replace Field Contents can be used with the calculation option to copy the value of this global field into a specified field for all records in the current found set.

          You can use the same tool when creating records by creating the group of records, then using replace field contents to update them or you can set up an auto-enter calculation on the table's date field that automatically enters the contents of the global date field each time a new record is created.

          • 2. Re: Entering a variable from a layout which will be placed in a field from a script
            CharlesEllis

            Thanks,

             

            I got it working - I had tried global storage, but ended up with a form into which I could not enter anything - I believe I had failed to make it a date field - I think I made it a container (which doen't work for this application).  Anyway, your encouragemant made me try it again and get it right this time.  I also used the set field command inbetween the OMIT statements on my duplication script. This allowed me to only change the dates only on one set of the duplicated records.

             

            Thanks for your quick and very intuitive answer... (I think you have done this a few times before!)

             

            Charles ...