6 Replies Latest reply on Feb 13, 2012 10:59 AM by comment

    Getting Sync between a calendar and different tables

    dunumba

      Hello, I'm making a DataBase composed by five sections:

      • Calendar: where are written the common events. I can see them for days, weeks, months... In this calendar,
      • But there are other four tables: sports, languages, music and theatre.

       

       

      What I want is that when I write a new activity in these sections, with specific dates, it appears in the common calendar. And if possible, that the data be updated constantly.

       

       

      I've tried two ways of making it, but I'm not too satisfied:

      • (A) When I create a new activity record, I can copy the data and paste in new event on the calendar through a script.
      • (B) When I create a new activity record, I can create a new event record and pass the data through a script which sets up the selected fields.

       

       

      Two problems are remaining in both possibilities

      • (1) The calendar fields are unique; for example, the field "Name of Activity" is common to every event, independently their original table. Of course, I can't update a field depending four sources.
      • (2) How to update the changed data in the calendar. I'd like to sync every table with the calendar in both directions, but it looks me rather impossible.

       

       

      I'll be very thankful for any help.

      Regards

      Dunumba / Damián

        • 1. Re: Getting Sync between a calendar and different tables
          beverly

          I script this for calendars, rather than relying on portals. Get the data from finds in the different tables and place into variables, then place into the field(s). I like to use one repeating field with 7 repeats for each week.

           

          Does that makes sense? THINK: how would you get this information manually, group it together and then output? Do the same in a script and push the values into variables and/or globals if dealing with different files. It's a way to do what would be complex JOINS in SQL, you're just storing each temporary find.

           

          I trigger the calendar UPDATE with each change (either way). It's very fast, even on remote access.

           

          If you want to change the data in the CALENDAR, then you need to have a way to pass the original record and update in the correct table. My advice is to just GO to that table and change there. UPDATE the calendar with those changes.

           

          Beverly

          • 2. Re: Getting Sync between a calendar and different tables
            comment

            dunumba wrote:

             

            • (1) The calendar fields are unique; for example, the field "Name of Activity" is common to every event, independently their original table.

             

            IMHO, all your calendar events should be in the same table. If different event types require different fieds, you can either have all the fields in the same table, with some fields being used only for some types of events, or use 4 sub-tables, one for each event type, with a one-to-one relationship to the Events table. The first option, though not strictly "correct", is much easier to set up and in most cases works out very well.

            • 3. Re: Getting Sync between a calendar and different tables
              dunumba

              Thank you, Beverly, I think like you. Perhaps I'll trigger the calendar update with the option "On record load" in the setup Layout menu.

              Michael,  I think your way is too dificult for my DB.

              Regards

              Damian

              • 4. Re: Getting Sync between a calendar and different tables
                thommmes

                Hi.

                 

                Maybe I have a language problem here, 'cause I do not really understand the problem.

                 

                Each event will be a single entry in your database, no matter where it comes from. So why don't you just add a reference field in your calender telling where it belongs?

                 

                Like that you can use relationships for updating events back and forth.

                 

                Excuse me if I am talking rubbish - as mentioned I'm not a native English speaker

                 

                Cheers Thommes

                • 5. Re: Getting Sync between a calendar and different tables
                  beverly

                  I think you probably understand correctly, thommmes.

                   

                  I also think this is what I understand.

                  If you have multiple PORTALS on each date, then you have to rely on those relationships (remember it's probably 6x7xtables for relationships - one for each possible DAY).

                   

                  My scripted method takes the relationships out of the problem. You can go grab the data from anywhere (scripted finds) and push it into the fields faster. And in remote instances (this is why I scripted this, as I have users in the field - literally - that have to access the calendar from out of the office), it is more efficient than multiple relationships.

                   

                  But if your situation is different and you can put those portals on the layout so that you physically are changing an entry there, then go for it!

                   

                  My method also allows faster FILTERING - based on who or which "category" you want to see. Just retrigger the script.

                   

                  I'm presenting an alternate option that I have used successfully. YMMV (your milage may vary),

                   

                  Beverly

                  • 6. Re: Getting Sync between a calendar and different tables
                    comment

                    dunumba wrote:

                     

                     

                    Michael,  I think your way is too dificult for my DB.

                     

                    I don't think anything could be simpler (I am referring to the option of one table with all the fields).