9 Replies Latest reply on Mar 7, 2013 1:35 PM by philmodjunk

    Calendar Layout help

    ericjlindholm

      Title

      Calendar Layout help

      Post


           A while back, PhilModJunk post a demo of a calendar layout.  I have it beautifully integrated into my database but as soon a multiple users are triggring the create month script, it messes with everyones view of the calendar.  Can you think of any way to make this work with mulitple users?

        • 1. Re: Calendar Layout help
          philmodjunk

               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.

          • 2. Re: Calendar Layout help
            ericjlindholm

                 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? 

            Freeze Window

            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

            New Record/Request
                                Set Field
            [ Weeks::Week; $Date ]
            Set Variable [ $Date; Value:$Date + 7 ]
            Exit Loop If [ Month ( $$CurrentMonth ) Month ( $Date ) ]

            End Loop
                                Go to Record/Request/Page

            [ First ]

            Commit Records/Requests

                  

            • 3. Re: Calendar Layout help
              philmodjunk
                   

                        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...

              • 4. Re: Calendar Layout help
                ericjlindholm

                     That would be great! I cant wait to see it. 

                • 5. Re: Calendar Layout help
                  philmodjunk

                       Ok!

                       Try downloading again from: https://www.dropbox.com/s/e8d03xvwe8vtz85/Calendar.fp7

                       To get a copy that does not delete Weeks records and thus should work smoothly in a multi-user environment.

                  • 6. Re: Calendar Layout help
                    ericjlindholm

                         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!

                    • 7. Re: Calendar Layout help
                      philmodjunk

                           This could be implemented by including it in the filter expression on the 7 portals or by including a filter field in the relationship.

                      • 8. Re: Calendar Layout help
                        ericjlindholm

                             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?

                        • 9. Re: Calendar Layout help
                          philmodjunk

                               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.