There are a number of calendar demos. SeedCode has one and I have this very simple calendar demo file: https://www.dropbox.com/s/e8d03xvwe8vtz85/Calendar.fp7
If you set up a field into which you can enter or select the desired number of dates, you could use code such as I've put in the following example. The example script creates random dates for the current month, but it can easily be adapted to work with any month you specify.
Set Variable [$DaysInMonth ; value: Let ( T = Get ( CurrentMonth ) ; Date ( Month ( T ) + 1 ; 0 ; Year ( T ) ) ) ]
Exit Loop If [ $K > YourTable::NumberOfDatesField ]
Set Variable [$RandDate ; Date ( Month ( Get ( CurrentDate ) ) ; Int ( Random * $DaysInMonth ) + 1 ; year ( get ( CurrentDate ) ) ) ]
If [ IsEmpty ( FilterValues ( $DateList ; $RandDate ) ) // new random date ]
Set Variable [ $DateList ; value: List ( $DateList ; $RandDate ) ]
Set Variable [$K ; value: $K + 1 ]
This creates a list of random dates separated by returns. Your script can then loop through them created one record in table used by your calendar layout for each date in the list, also with the employee's ID so that you can link the date to an employee.
thanks for your help.
I am new to file maker as you can tell. Sounds like I need to learn a lot more about scripts. any suggestion as to what the best training via the web would be?
also when you said create a loop to create a record in the calendar table would that loop be added to the example script you posted or would it be a new script to run after the 1st script?
"best training" will be different for each individual. Each person starts with a different basic skill set and a unique set of skills/challenges for learning new information. You'll need to research and evaluate your options.
when you said create a loop to create a record in the calendar table would that loop be added to the example script you posted or would it be a new script to run after the 1st script?
Either option produces exactly the same result so long as the second script can access the list produced by the first. If you use separate scripts, you would need to use a) a global variable ($$); b) a field, or c) pass the list as a script parameter to make that list available to a second script.
Thus, adding that scripting to the end of my example script will be simpler.