Answers.Body: <p>Depends what you want the 'link' to do, but you could set the type B activities as follow-up activities to the type A using the <code>parent_id</code> attribute - which is pretty much the same as your approach but using a standard field instead of custom.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-15T20:03:54.403Z
Answers.Text: I had looked at that but the comment for the field is that is for the follow-up functionality and that it is not implemented.  If we use this and then this field starts getting used I am concerned it could be problematic.  It would be nice to not have worry about custom fields.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T07:44:34.660Z
Answers.Text: The 'not implemented' field comment is outdated - you can create an activity via the GUI and use the last section to add a follow-up activity that uses `parent_id`
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T15:28:07.307Z
Answers.Text: is it a problem to use the field for something else besides the follow-up? I would think it is fine but I just do not want to get into trouble some upgrade down the line.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-15T09:57:43.037Z
Answers.LastActivityDate: 2017-07-15T09:57:43.037Z
Answers.UserDisplayName: Aidan
Body: <p>I have a case where I would like to be able to create linked activities.  This is already in the context of a case so a case will not work.  </p>
  
  <p>An activity of type A might have 4 or five of type B that are related to it. </p>
  
  <p>I do not think this is possible with CiviCRM but I want to check before I build something custom.  </p>
  
  <p>I am thinking of just populating the ID of Activity A in a custom field for Activity B and then I can query accordingly and use Views to show my results.  </p>
  
  <p>Any other ideas are greatly appreciated.  </p>
  
  <p>Thanks,
  Josh</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-14T20:35:37.450Z
Comments.Text: Hi Josh/Steve - it might help if you could describe your requirements in terms of the actual workflow in case someone has an 'ah ha' moment that would get you what you want without linking Activities
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-15T21:25:05.030Z
Comments.Text: Basically, there is an element of the case and a primary contact that is doing that part of the case.  So call it Case Part 1 but there may be ten little things as part of Case Part.  I need them to be related because I will be adding up some data from custom fields in the smaller activities.
Comments.UserDisplayName: Josh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-15T23:16:34.710Z
Comments.Text: Thanks but that hasn't helped me really grasp the use case/ work flow so not sure what I can advise/suggest
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-16T05:32:21.860Z
Comments.Text: @petednz - fuzion Hopefully, this will help with some additional clarity.   https://s3-us-west-2.amazonaws.com/onlinesharing18/civicrm/sub-task_need_example.png -
   As you can see there are numeric values for each of the subtasks.  The project parts will need to be used to aggregate the totals of these fields. The project part also has custom fields that relate to the part and the subtasks will have other additional data.  I hope this helps clarify things. I appreciate your interest in understanding the use case.  Thanks, Josh
Comments.UserDisplayName: Josh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-16T06:33:28.573Z
Comments.Text: So are you saying that Project Part One is one Activity Type, and Sub-Task A is another Activity type that needs linking. I still feel too in the dark to advise to be honest.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-16T09:26:08.180Z
Comments.Text: Yes.  Project Part One is an activity type.   Sub-Task A  would be another activity type.  This way from the case I can find any project parts and from the project parts, I can find any of its sub-tasks. The plan is to use Drupal Views to do the querying and I am thinking I will make the link by filling in a value programmatically with Entity CiviCRM.  Basically,  have a create a sub-task button and then populate the ID of the project part.
Comments.UserDisplayName: Josh
Tags: <activities>
Title: Linking Activities
ThreadText: # Linking Activities
  
  (Asked by: username_0 on 2017-07-14)
  
  I have a case where I would like to be able to create linked activities. This is already in the context of a case so a case will not work.
  
  An activity of type A might have 4 or five of type B that are related to it.
  
  I do not think this is possible with CiviCRM but I want to check before I build something custom.
  
  I am thinking of just populating the ID of Activity A in a custom field for Activity B and then I can query accordingly and use Views to show my results.
  
  Any other ideas are greatly appreciated.
  
  Thanks,
  username_0
  
  **Tags:** activities
  
  > **Comments:**
  > **username_1**: Hi username_0/Steve - it might help if you could describe your requirements in terms of the actual workflow in case someone has an 'ah ha' moment that would get you what you want without linking Activities  
  > **username_0**: Basically, there is an element of the case and a primary contact that is doing that part of the case.  So call it Case Part 1 but there may be ten little things as part of Case Part.  I need them to be related because I will be adding up some data from custom fields in the smaller activities.  
  > **username_1**: Thanks but that hasn't helped me really grasp the use case/ work flow so not sure what I can advise/suggest  
  > **username_0**: @username_1 Hopefully, this will help with some additional clarity.   https://s3-us-west-2.amazonaws.com/onlinesharing18/civicrm/sub-task_need_example.png -  As you can see there are numeric values for each of the subtasks.  The project parts will need to be used to aggregate the totals of these fields. The project part also has custom fields that relate to the part and the subtasks will have other additional data.  I hope this helps clarify things. I appreciate your interest in understanding the use case.  Thanks, username_0  
  > **username_1**: So are you saying that Project Part One is one Activity Type, and Sub-Task A is another Activity type that needs linking. I still feel too in the dark to advise to be honest.  
  > **username_0**: Yes.  Project Part One is an activity type.   Sub-Task A  would be another activity type.  This way from the case I can find any project parts and from the project parts, I can find any of its sub-tasks. The plan is to use Drupal Views to do the querying and I am thinking I will make the link by filling in a value programmatically with Entity CiviCRM.  Basically,  have a create a sub-task button and then populate the ID of the project part.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-07-15. Score: 2
  
  Depends what you want the 'link' to do, but you could set the type B activities as follow-up activities to the type A using the `parent_id` attribute - which is pretty much the same as your approach but using a standard field instead of custom.
  
  > **Comments:**
  > **username_0**: I had looked at that but the comment for the field is that is for the follow-up functionality and that it is not implemented.  If we use this and then this field starts getting used I am concerned it could be problematic.  It would be nice to not have worry about custom fields.  
  > **username_2**: The 'not implemented' field comment is outdated - you can create an activity via the GUI and use the last section to add a follow-up activity that uses `parent_id`  
  > **username_0**: is it a problem to use the field for something else besides the follow-up? I would think it is fine but I just do not want to get into trouble some upgrade down the line.  
  
  ---
  
  