Modify the script so that it does not delete or create records in the weeks table.
Instead, the script can check for the existance of the required records and create them if they are not present.
Im not sure how to write that script. This is the script as it was written in your demo. If it leaves all the weeks that are created, my calendar view show more then one month at a time?
Set Variable [ $$CurrentMonth; Value:Let ( m = GetAsDate ( Get ( ScriptParameter ) ) ; If ( IsEmpty ( m ) ; Get ( CurrentDate ) ; m ) ) ] Set Variable [ $$CurrentMonth; Value:$$CurrentMonth - Day ( $$CurrentMonth ) + 1 ]
Go to Layout [ “Cal View” (Weeks) ]
Show All Records
Delete All Records
[ No dialog ]
Set Variable [ $Date; Value:$$CurrentMonth - DayOfWeek ( $$CurrentMonth ) + 1 ] Loop
Set Field [ Weeks::Week; $Date ]
Set Variable [ $Date; Value:$Date + 7 ]
Exit Loop If [ Month ( $$CurrentMonth ) ≠ Month ( $Date ) ]
Go to Record/Request/Page
[ First ]
If it leaves all the weeks that are created, my calendar view show more then one month at a time?
This can be handled by performing a find to pull up all weeks records for a given date range spanning one month.
You've raised a very good issue here. I'm thinking of updating this demo to resolve that issue. Stay tuned...
That would be great! I cant wait to see it.
its beautiful! works like a charm. I am thinking I can use the same table with a copy of this layout to show different things. I could for example, this calendar shows events but I could use one for my labor scheduling and task management very easily. Thanks again!
This could be implemented by including it in the filter expression on the 7 portals or by including a filter field in the relationship.
My schedule table is different from the events table. I could duplicate the weeks layout and change the portal to schedule days. or If i did that would it be easier to create a seperate weeks table for schedule?
Doesn't seem like it would make much difference either way.
The main issue to examine carefully is the fact that your schedule days records are in their own table instead of included as records in the same events table currently being displayed by the calendar. That keeps you from seeing any records from events ahd schedule days at the same time on the calendar and any 'detail view' layouts derived from it will have a similar challenge. That may not be a major issue for you, but it's one that can be avoided if you merge your schedule days and events tables.