Answers.Body: <p>When you edit a case activity, it creates a new version of it, and that does indeed have a different ID.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-19T20:16:29.473Z
Answers.LastActivityDate: 2016-11-19T20:16:29.473Z
Answers.UserDisplayName: naomi
Body: <p>I've got a Drupal View that identifies a specific activity within a case and provides a link to the activity using its ID number. It appears to be working correctly in the majority of use cases, where I can simply filter out deleted cases, and filter on the activity type, status and current revision to find the right activity. </p>
  
  <p>However, in some cases the view is showing me a link to an activity which I can't see when I view the 'Manage Case' screen. Indeed the activity ID that the view is presenting doesn't even show up when I search within CiviCRM for activities that match the other filters I'm using in the view.</p>
  
  <p>It looks like CiviCRM - at least in the version I'm using in this case - is changing the ID number of activities when the activity gets edited?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-23T20:08:01.613Z
Comments.Text: Can you find that activity id anywhere in the system?  I'm on 4.6.3 and have never noticed activity ids changing on editing.  Are the activities created through a webform or the Civi UI?
Comments.UserDisplayName: pmoz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-23T20:16:37.657Z
Comments.Text: Have you filtered on Case Type?
Comments.UserDisplayName: pmoz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-23T20:19:51.423Z
Comments.Text: any chance it is related to Deleted Cases?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-23T22:12:11.453Z
Comments.Text: Thanks for the comments.  Deleted cases are filtered out, and I am filtering on case type. I do think there is an issue with the activity IDs. for example, if I file an activity on a case the ID changes, so I think the next step is to upgrade - we're running 4.4.5 I think at present, so I'll move it up to 4.5.x as a first step and see if that resolves the problem.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-24T10:39:35.320Z
Comments.Text: hi Graham, I've come across the same issue. Within a case you would expect the activities to keep the same IDs, but what I've noticed is that in the database CiviCRM will create duplicate activities (as a copy). This does mean the activity ID won't be the same next time you use it.
Comments.UserDisplayName: Jon-man
Tags: <activities>
Title: How to set up the filtering in Drupal Views to target the correct CiviCRM Activity
ThreadText: # How to set up the filtering in Drupal Views to target the correct CiviCRM Activity
  
  (Asked by: username_0 on 2015-06-23)
  
  I've got a Drupal View that identifies a specific activity within a case and provides a link to the activity using its ID number. It appears to be working correctly in the majority of use cases, where I can simply filter out deleted cases, and filter on the activity type, status and current revision to find the right activity.
  
  However, in some cases the view is showing me a link to an activity which I can't see when I view the 'Manage Case' screen. Indeed the activity ID that the view is presenting doesn't even show up when I search within CiviCRM for activities that match the other filters I'm using in the view.
  
  It looks like CiviCRM - at least in the version I'm using in this case - is changing the ID number of activities when the activity gets edited?
  
  **Tags:** activities
  
  > **Comments:**
  > **username_1**: Can you find that activity id anywhere in the system?  I'm on 4.6.3 and have never noticed activity ids changing on editing.  Are the activities created through a webform or the Civi UI?  
  > **username_1**: Have you filtered on Case Type?  
  > **username_2**: any chance it is related to Deleted Cases?  
  > **username_0**: Thanks for the comments.  Deleted cases are filtered out, and I am filtering on case type. I do think there is an issue with the activity IDs. for example, if I file an activity on a case the ID changes, so I think the next step is to upgrade - we're running 4.4.5 I think at present, so I'll move it up to 4.5.x as a first step and see if that resolves the problem.  
  > **username_3**: hi username_0, I've come across the same issue. Within a case you would expect the activities to keep the same IDs, but what I've noticed is that in the database CiviCRM will create duplicate activities (as a copy). This does mean the activity ID won't be the same next time you use it.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2016-11-19. Score: 2
  
  When you edit a case activity, it creates a new version of it, and that does indeed have a different ID.
  
  
  ---
  
  