Community
Showing results for 
Search instead for 
Do you mean 
Reply
Accepted Solution

Recuring Activity

Copper Super Contributor
Posts: 485
Country: Australia

Re: Recuring Activity

Thanks Sam

It looks similar to my code a the start some minor changes, i will do a line for line compare

As for the Task List i have backed up and done a database check, still the same, also the first client you open up after starting Act, shows Activities for me the user no mater which contact record i first open

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Copper Super Contributor
Posts: 485
Country: Australia

Re: Recuring Activity

Another odd bit if i do a custom date filter on the Task List they all show up... go figure

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Copper Super Contributor
Posts: 485
Country: Australia

Re: Recuring Activity

This is my whole button code at the moment, i have multiple buttons in the contact record each create about 20 Activities except this one hence why i am testing it here

 

    class Button1 : System.Windows.Forms.Button
    {
        protected override void OnClick(System.EventArgs e)
        {
            Contact c = Act.UI.ActApplication.Instance.ApplicationState.CurrentContact;

            //List out the activity types
            Act.Framework.Activities.ActivityType[] activityTypes = Act.UI.ActApplication.Instance.ActFramework.Activities.GetActivityTypes();
            
            //set a new activity template link
            Act.Framework.Activities.ActivityTemplate aTemplate;

            //Roll through each activity type and establish new activites 
            foreach (Act.Framework.Activities.ActivityType a in activityTypes)
            {
                if (a.Name == "To-do")
                {
                    string regarding = "Mail In";
                    string details = "Snail Mail has been received for this client\n\n Details:\n\nBulk Scan: Yes / No\nBulk Scan Date:\n\nFile Copy Scan: Yes / No";
                    string location = "Office";

                    aTemplate = Act.UI.ActApplication.Instance.ActFramework.Activities.CreateActivity(a);
                    aTemplate.ActivityContacts.Add(c);
                    aTemplate.StartTime = System.DateTime.Now;
                    aTemplate.EndTime = System.DateTime.Now.AddMinutes(5);
                    aTemplate.Regarding = regarding;
                    aTemplate.Location = location;
                    aTemplate.Details = details;
                    aTemplate.Priority = Act.UI.ActApplication.Instance.ActFramework.Activities.GetActivityPriority("Low");

                    ActivityRecurSpec recurSpec = (ActivityRecurSpec)aTemplate.RecurSpec.Clone();

                    // Set the recuring pattern
                    // recurSpec.Period = ActivityRecurPeriod.Yearly;
                    // recurSpec.Period = ActivityRecurPeriod.Monthly;
                    // recurSpec.Period = ActivityRecurPeriod.Weekly;
                    // recurSpec.Period = ActivityRecurPeriod.Daily;

                    // OCCURS ON 10TH OF EVERY MONTH
                    ActivityRecurDay activityRecurDay = new ActivityRecurDay(10);
                    recurSpec.DayType = ActivityRecurDayType.Numbered;
                    recurSpec.Day = activityRecurDay;

                    // WHICH MONTH TO RECUR ON, USED FOR YEARLY ACTIVITIES
                    // recurSpec.Month = 1;

                    // HAS AN END DATE
                    recurSpec.IsEndless = false;
                    recurSpec.EndDate = DateTime.Now.AddYears(1);

                    // OCCURS EVERY 1 MONTH
                    recurSpec.Period = ActivityRecurPeriod.Monthly;
                    recurSpec.Frequency = 1;

                    // USED WITH NAMED DAYS, LETS YOU SPECIFY "EVERY THIRD THURSDAY" FOR EXAMPLE
                    // recurSpec.Modifier = ActivityRecurModifier.None;

                    aTemplate.RecurSpec = recurSpec;

                    aTemplate.Update();
                }
            }

            c.Update();

            Act.UI.ActApplication.Instance.RefreshLoadedViews();
        }
    }

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Recuring Activity

If the database maintenance all passes without issue then the only other thing I've seen cause similar problem is corrupt Act! preferences.

There's a KB on rebuilding them here: http://kb.swiftpage.com/app/answers/detail/a_id/14770

 

If it's still not working it does sound like the database may be damaged in one way or another.

Usually the easiest thing to try is to create a new Act! user, then delete your old one and choose to transfer all work.

You can then re-test.

 

I'll speak to my colleague that collates our known issues this afternoon and see if there's anything else that comes to mind.

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.
Copper Super Contributor
Posts: 485
Country: Australia

Re: Recuring Activity

Thanks

When i mess around with the filters i can get everything up to the 29/08/2015 but nothing beyond that

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Recuring Activity

I've copied and pasted your code verbatim into a new project and it works fine.

It creates a recurring activity for the current contact with the correct details.

I'm using the Act! 17.2 framework, but it shouldn't really matter.

 

I'll get back to you about the other issue. I'm waiting on the arrival of my colleague.

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.
Solution
Accepted by topic author JasonD
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Recuring Activity

My colleague and I think that somehow we've managed to save an activity with an invalid recurspec into the database despite the safeguards. When the Task List encounters this invalid activity it causes it to quietly crash and not load anything. When you apply a filter which hides the invalid activity they all load fine.

 

This is a difficult one because there's not really a way to find specifically which activity it is without some luck.

Normally we have to perform a blanket reset of all recurring activities to fix the issue.

 

Is this dummy data that you've been testing on, or is this a live database?

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.
Bronze Elite Contributor
Posts: 2,119
Country: United_Kingdom

Re: Recuring Activity

You could run SQL Profiler which would give you the failed ActivityID fed back from any constraint violation?

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Copper Super Contributor
Posts: 86
Country: United_Kingdom

Re: Recuring Activity


@vivek wrote:

You could run SQL Profiler which would give you the failed ActivityID fed back from any constraint violation?


Unfortunately I don't think it violates any constraints as you wouldn't have been able to insert the row in the first place. I think it's the framework itself that's meant to safeguard against incorrect recurspec's but obviously something has crept through. This is why I always use the ActivityUtility to validate the recurspec before assigning it back to the activity. It's usually silly things like the recurday being set to 32 which of course is invalid but not bad enough to violate a constraint.

____________________________________________________________

Unfortunately I no longer work for Swiftpage International. Please do not send any queries to this account.
Bronze Elite Contributor
Posts: 2,119
Country: United_Kingdom

Re: Recuring Activity

Ahh ok.
Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog