Community
Showing results for 
Search instead for 
Do you mean 
Reply

Bug or Feature? ActivityID repeated, but different data records, within ActivityList

Accepted Solution Solved
Copper Contributor
Posts: 14
Country: United States
Accepted Solution

Bug or Feature? ActivityID repeated, but different data records, within ActivityList

[ Edited ]
I am receiving duplicate Activity IDs in the results of an Activity query. This is probably a corruption in the target database, but all attempts to re-index and/or repair the database have no effect on this issue.

My questions are: Is this a feature or a bug? Has anyone else encountered this problem? What set of circumstances cause this problem?

The query is relatively simple (see code in next post below).


Out of the 1,000+ Activities returned by this query, there are two ActivityIDs (GUIDs) that are duplicated in more than one record within the list. One “duplicate set” is comprised of 4 Activity records and the other is comprised of 3 (so, 7 questionable records in all). What seems to indicate a bug is that fact that, although the records in each of these “duplicate sets” share the same GUID, the data within the individual Activity records is NOT the same. Until now, I have presumed that ActivityID is a primary key (unique record identifier).

Here’s some facts about the first dupe case comprised of 4 Activity records (the second case is similar):
• Each Activity record is associated with the same set of 9 Contacts
• All records have the same CreateDate and ScheduledBy (creator)
• All records have the same StartTime, EndTime, and Duration
• All records have IsCleared = False (consistent with my query filter)
• 2 records have IsAlarmed = True and IsAlarmCleared = True (the other 2 are False in both fields)
• 2 records have InvitationStatus = Declined and IsInvitationAcknowledged = True
• 1 record has InvitationStatus = Tentative and IsInvitationAcknowledged = False
• 1 record has InvitationStatus = Deleted and IsInvitationAcknowledged = True

Finally, examining each of the associated 9 Contacts via the ACT user interface, the Activity in question is listed on the Activities tab and is CLEARED in ALL 9 instances! However, the pop-up menu displayed when right-clicking on the Activity has “Clear Activity…” enabled and “View Details” disabled (grayed out).
Message Edited by steve.m on 05-04-2010 07:32 AM
Message Edited by steve.m on 05-04-2010 07:32 AM
Message Edited by steve.m on 05-04-2010 07:33 AM
Message Edited by steve.m on 05-04-2010 07:35 AM

Accepted Solutions
Solution
Accepted by topic author steve.m
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Bug or Feature? ActivityID repeated, but different data records, within ActivityList

ActivityID shouldn't ever be duplicated, nor should the master ID.

 

The anomalous behavior your seeing is likely indicative of a problem with that particular database.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Copper Contributor
Posts: 14
Country: United States

Re: Bug or Feature? ActivityID repeated, but different data records, within ActivityList

[ Edited ]
Had trouble inserting this in original post


// set up sort and filter criteria for Activity query
ActivityFieldDescriptor starttimeFD = new ActivityFieldDescriptor(ActivityField.StartTime);
ActivitySortCriteria sortByDateAscending = new ActivitySortCriteria(starttimeFD,
System.ComponentModel.ListSortDirection.Ascending);

ActivityFieldDescriptor isclearedFD = new ActivityFieldDescriptor(ActivityField.IsCleared);
ActivityFieldDescriptor iseventFD = new ActivityFieldDescriptor(ActivityField.IsEvent);
ActivityFieldDescriptor isrecurringFD = new ActivityFieldDescriptor(ActivityField.IsRecurringEvent);
IActivityFilterCriteria[] filterByUnclearedNonrecurring = new IActivityFilterCriteria[]
{
new ActivityComparisonFilterCriteria(isclearedFD,
Act.Framework.ComparisonFilterCriteria.Operation.Equals,
false),
new ActivityComparisonFilterCriteria(iseventFD,
Act.Framework.ComparisonFilterCriteria.Operation.Equals,
false),
new ActivityComparisonFilterCriteria(isrecurringFD,
Act.Framework.ComparisonFilterCriteria.Operation.Equals,
false)
};

// retrieve the Activity List
ActivityList activityList = _activityMgr.GetActivityList(sortByDateAscending, filterByUnclearedNonrecurring,
DateTime.MinValue, DateTime.MaxValue);

Message Edited by steve.m on 05-04-2010 07:47 AM
Message Edited by steve.m on 05-04-2010 07:49 AM
Solution
Accepted by topic author steve.m
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Bug or Feature? ActivityID repeated, but different data records, within ActivityList

ActivityID shouldn't ever be duplicated, nor should the master ID.

 

The anomalous behavior your seeing is likely indicative of a problem with that particular database.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 14
Country: United States

Re: Bug or Feature? ActivityID repeated, but different data records, within ActivityList

[ Edited ]
I left out one possibly VERY IMPORTANT fact: In both of the duplicate ID cases, the users who created the original Activity are now Inactive Users. I was wondering if this problem occured perhaps due to marking these Users as Inactive while they still had open Activity invitations awaiting a response. Also, any ideas on how to clean this database? Perhaps I should just Update one of Activity instances (having a dupe ID) and see what happens. Or maybe Unclear it in the user interface and then re-clear it. I obviously don't want to corrupt this database any further.
Message Edited by steve.m on 05-04-2010 07:57 AM
Employee
Posts: 1,163
Country: USA

Re: Bug or Feature? ActivityID repeated, but different data records, within ActivityList

I wouldn't guess that would be a factor as the demo database has several inactive users with activities that are still open, yet I was unable to find any duplicated ID's in the activity table.
Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 14
Country: United States

Re: Bug or Feature? ActivityID repeated, but different data records, within ActivityList

I was able to get these bogus records off of the database by going into the user interface, finding the Activity on one of the associated Contacts, unclearing it, then erasing the Activity altogether. This removed the Activity for all associated Contacts and removed the ActivityID from the database (although I suspect there are un-indexed Activity records remaining on the database that will be purged during the next database repair). From this experience, is it correct that the ACT database structure does not enforce primary key integrity at the physical SQL Table level, but rather via Framework code and related auxillary key (and relatonship) tables? (My query was able to retrieve records having duplicate keys, thus, it is clear that data was retrieved from a Table that contained distinct instances of the "duplicate" records.)