Answers.Body: <p>You may want to try &quot;Contact Reference&quot; or &quot;Entity Reference&quot; (in the latest CiviCRM versions) as one of the user-defined fields - much depending from your set-up details and needs so it's tricky to narrow the exact configuration parameters here.</p>
  <p><a href="https://i.sstatic.net/eAewy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eAewy.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-12T10:33:18.943Z
Answers.Text: Thanks for your awnser. That's not what I'm looking for. I already use the contact reference and want to keep it that way. In addition, a relationship should be created automatically. As with employer and employee. How could that work?
Answers.UserDisplayName: Gregor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-12T12:10:05.487Z
Answers.Text: In that case you may want to consider some custom coding in an extension, which fills custom fields with data. Or maybe CiviRules is an answer  - depending of how sophisticated your exact requirements are.
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-15T12:13:57.657Z
Answers.Text: Thank you very much for the answer, it looks like it could work. Even if I haven't found the right setting in CiviRules yet.
Answers.UserDisplayName: Gregor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-28T11:05:26.970Z
Answers.LastActivityDate: 2023-11-28T11:05:26.970Z
Answers.UserDisplayName: yurg
Body: <p>We work with three contact categories that always belong together in some way (people who form groups and are interested in a house).</p>
  <p>I have used the Employe field for the connection between the people and their groups and find it really great that it then also creates the corresponding relationship for both contacts.</p>
  <p>Is there a way to store the same functionality in the user-defined fields that I have created, e.g. property (house) and owner (person)?</p>
  <p>Many thanks
  Gregor</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-28T19:00:52.180Z
Comments.Text: another approach is to make the 'property' a contact, and then use a custom Relationship Type - we did this for a housing based project (delivering energy audits) where the 'house' or 'property' is an 'entity' by making an Organisational sub-type called Property, then just using Relationships to weave the web of occupiers, contractors, property etc. may work for you too
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-12-12T10:31:15.117Z
Comments.Text: Yes, we have some less experienced users, so we want to show everything on the summary page. There are contact references to the "properties" of the "project groups". We have done this exactly as you have described. Unfortunately, entering the contact reference does not create a reference, so the project group is not stored on the "property" page. However, this is programmed and works for the employer and employee pair. How can I retrofit this for the other fields?
Comments.UserDisplayName: Gregor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-12-12T20:44:32.293Z
Comments.Text: In CiviCRM employee/employer is just a special use case that involves both a relationship and a value for 'is current' on the contact record (and custom display option so it shows on the Contact Summary). If you use a relationship you can then an extension or possibly  the Contact Layout Builder to show the relationships on the Contact Summary screen
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-12-12T20:45:49.687Z
Comments.Text: IE if your key need is to 'show' the relationship on same screen as where 'current employer' shows then this should be doable
Comments.UserDisplayName: petednz - fuzion
Tags: <contacts><relationships>
Title: Create links between contacts that create corresponding relationships in the background
ThreadText: # Create links between contacts that create corresponding relationships in the background
  
  (Asked by: username_0 on 2023-11-28)
  
  We work with three contact categories that always belong together in some way (people who form groups and are interested in a house).
  
  I have used the Employe field for the connection between the people and their groups and find it really great that it then also creates the corresponding relationship for both contacts.
  
  Is there a way to store the same functionality in the user-defined fields that I have created, e.g. property (house) and owner (person)?
  
  Many thanks
  username_0
  
  **Tags:** contacts, relationships
  
  > **Comments:**
  > **username_1**: another approach is to make the 'property' a contact, and then use a custom Relationship Type - we did this for a housing based project (delivering energy audits) where the 'house' or 'property' is an 'entity' by making an Organisational sub-type called Property, then just using Relationships to weave the web of occupiers, contractors, property etc. may work for you too  
  > **username_0**: Yes, we have some less experienced users, so we want to show everything on the summary page. There are contact references to the "properties" of the "project groups". We have done this exactly as you have described. Unfortunately, entering the contact reference does not create a reference, so the project group is not stored on the "property" page. However, this is programmed and works for the employer and employee pair. How can I retrofit this for the other fields?  
  > **username_1**: In CiviCRM employee/employer is just a special use case that involves both a relationship and a value for 'is current' on the contact record (and custom display option so it shows on the Contact Summary). If you use a relationship you can then an extension or possibly  the Contact Layout Builder to show the relationships on the Contact Summary screen  
  > **username_1**: IE if your key need is to 'show' the relationship on same screen as where 'current employer' shows then this should be doable  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-11-28. Score: 1
  
  You may want to try "Contact Reference" or "Entity Reference" (in the latest CiviCRM versions) as one of the user-defined fields - much depending from your set-up details and needs so it's tricky to narrow the exact configuration parameters here.
  
  [![enter image description here](https://i.sstatic.net/eAewy.png)](https://i.sstatic.net/eAewy.png)
  
  > **Comments:**
  > **username_0**: Thanks for your awnser. That's not what I'm looking for. I already use the contact reference and want to keep it that way. In addition, a relationship should be created automatically. As with employer and employee. How could that work?  
  > **username_2**: In that case you may want to consider some custom coding in an extension, which fills custom fields with data. Or maybe CiviRules is an answer  - depending of how sophisticated your exact requirements are.  
  > **username_0**: Thank you very much for the answer, it looks like it could work. Even if I haven't found the right setting in CiviRules yet.  
  
  ---
  
  