3 Replies Latest reply on Aug 1, 2011 10:33 AM by philmodjunk

    Date from list of many into a new field?

    BruceBono

      Title

      Date from list of many into a new field?

      Post

      I am trying to build a simple scheduling tool for school courses.

      I built  fields for each day of the year...7 across representing one full week and 52 down.

      I would like to be able to just click on one of these date fields and have it entered as a new date for the class, instead of having to actually use the drop down calendar to search for the dates.

      As I want to use a grid-like display for the year to see the overview, I am wondering how to actually approach this...without having hundreds of scripts to slow everything down to a crawl.

      Is this at all possible and if so, how do I go about doing this?

      Thanks for any help and ideas.

        • 1. Re: Date from list of many into a new field?
          philmodjunk

          You might want to download and examine this simple calendar demo file: http://www.4shared.com/file/6UAOV_RZ/Calendar.html

          Feel free to post back here with questions if there's some part of it's design that you don't understand.

          You can set up all your date fields as buttons. In button setup, you can specify a script parameter. If you enter the name of the field you just set up as a button, you can pass the date in the date field as a parameter to the script. Your script can then use a step like this:

          Set Field [YourTable::FieldToStorerSelectedDate ; Get ( ScriptParameter ) ]

          Note: sometimes script parameter values end up as text and this may be the case here. If you find this step doesn't work try it this way:

          Set Field [YourTable::FieldToStorerSelectedDate ; GetAsDate ( Get ( ScriptParameter ) ) ]

          • 2. Re: Date from list of many into a new field?
            BruceBono

            Thanks for your help, Phil.

            The Set Field idea is great. But I cannot seem to figure out how to make it all work. I am using 2 tables.

            Table 1 is Year Overview and it contains records of the Courses.

            Table 2 is Classes Database and it collects classes related to the courses.

            My new question now is, which table should these date buttons originate?

            I have tried from both, but always the same result...a new record with only a date in the Classes Database. 

            Actually, I am not at all clear on how to make this script work. It should allow me to click on a date button (from Year Overview) and have it create a new record in Classes Database using the chosen date, along with passing all related info from Year Overview into the Classes Database...like Course ID, Course Name, Course Teacher, Default starting time, default room, etc.

            but, so far, it only gives me a new record with the right date.

            Thank you again for your help...as always.

            What am I missing here? I just can't see it. 

            • 3. Re: Date from list of many into a new field?
              philmodjunk

              Set Variable [$CourseID ; value: Year Overview::CourseID ]
              Go To Layout [Classes]
              New record/Request
              Set Field [classes::CourseID ; $CourseID ]
              Set Field [classes::Date ; Get ( ScriptParameter ) ]

              I don't recommend putting "Course Name, Course Teacher, Default starting time, default room, etc." into the classes table unless these values might be different in each class record for a given course. If that is the case (such as your starting time), set a looked up value field option on this field in classes set to use this CourseID based relationship to look up the value from the Year Overview table.