Community
Showing results for 
Search instead for 
Do you mean 
Reply

Adding a new activitySeries via the API fails and corrupts db

New Member
Posts: 5
Country: USA

Adding a new activitySeries via the API fails and corrupts db

Using: Act! Premium (Web) Version: 19.2.141.0.

 

I am trying to get the activitySeries command to work for adding certain recurring types. It works fine for some types, but for a couple recurrence pattern types it fails, and then future API commands to list the data give errors. The UI in a browser also fails from that point on when trying to load the calendar (logs the user out of the browser and displays an error).

 

I am trying to make a "Monthly every 2nd Monday" type. Here is what I send to "/Act.Web.API/api/ActivitySeries".

 

{"subject":"monthly second monday","startTime":"2017-06-12T08:30:00-07:00","endTime":"2017-06-12T09:00:00-07:00","isTimeless":false,"location":"","activityPriorityName":"High","activityTypeName":"Meeting","details":"","contacts":[{"id":"b540abde-9386-407e-867e-f527b146adf0","displayName":"Admin"}],"recurSpec":{"recurType":"Monthly","frequency":1,"seriesStart":"2017-06-12T15:30:00Z","day":{"dayAsInt":2,"dayType":"Named","daysOfWeek":["Monday"],"ordinal":"Second","typedDay":"None"},"month":0,"seriesEnd":"2018-06-11T22:30:00Z"},"seriesId":""}

 

Server response (http 500 error):

 

{
  "message": "An error has occurred.",
  "exceptionMessage": "Error: Invalid recur spec. Monthly named-day pattern with no Modifier.",
  "exceptionType": "System.ApplicationException",
  "stackTrace": "   at Act.Framework.Activities.ActivityRecurUtility.YMNamedDayExtrusion(ActivityRecurSpec recurSpec, DateTime activityStartTime, DateTime startRange, DateTime endRange)\r\n   at Act.Framework.Activities.ActivityRecurUtility.MonthlyOccurrences(ActivityRecurSpec recurSpec, DateTime activityStartTime, DateTime startRange, DateTime endRange)\r\n   at Act.Framework.Activities.ActivityRecurUtility.GetActivityOccurrenceDates(ActivityRecurSpec recurSpec, DateTime activityStartTime, DateTime activityEndTime, DateTime startRange, DateTime endRange)\r\n   at Act.Framework.Activities.ActivityManagerDB.GenerateActivitiesFromBaseData(ActivityBaseData[] baseDataItems, DateTime startRange, DateTime endRange, Boolean onlyFirstUnclearedInRange, Boolean onlyFirstInstance)\r\n   at Act.Framework.Activities.ActivityManager.GetActivities(IActivityFilterCriteria[] filterCriteria, IActivityFilterCriteria[] userFilterCriteria, ActivityAccessor[] accessors, Contact contact, Boolean includeEvents, Boolean firstUnclearedOnly, Boolean firstInstanceOnly, RetrievalMode retrievalMode, DateTime startRange, DateTime endRange)\r\n   at Act.Framework.Activities.ActivityManager.GetActivityList(ActivitySortCriteria sort, IActivityFilterCriteria[] filterCriteria, IActivityFilterCriteria[] userFilterCriteria, ActivityAccessor[] accessors, Contact contact, Boolean includeEvents, Boolean firstUnclearedOnly, RetrievalMode retrievalMode, DateTime startRange, DateTime endRange)\r\n   at act.web.api.Services.ActivityService.GetSeries(ActFramework framework, IDictionary`2 mappers, Guid id)\r\n   at act.web.api.Services.ActivityService.CreateSeries(ActFramework framework, IDictionary`2 mappers, ActivitySeries series, Nullable`1 organizerId)\r\n   at act.web.api.Controllers.ActivitySeriesController.Post(ActivitySeries series)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at act.web.api.Security.SecureMessageAttribute.<ExecuteActionFilterAsync>d__c.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Cors.CorsMessageHandler.<SendAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNet.WebApi.Extensions.Compression.Server.BaseServerCompressionHandler.<SendAsync>d__21.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"
}

 

 

 

 

Employee
Posts: 38
Country: USA

Re: Adding a new activitySeries via the API fails and corrupts db

Hi,

 

I have opened a defect and have solved this issue.  The fix will be in the next release of the API.

 

What is happening is that the ordinal in the recurSpec.day is not being saved to the database and it is always defaulted to 0.

 

In the TBL_ACTIVITY table the RECURMODIFIER column is 0.  In your case it should be 2.

 

Recur Modifiers are:

        None = 0,
        First = 1,
        Second = 2,
        Third = 3,
        Fourth = 4,
        Last = 5

 

Thanks for being this to our attention.

Stephen