Answers.Body: <p>You really don't want to be modifying core files to do that.  See <a href="https://civicrm.stackexchange.com/q/39625/225">here</a> for a different approach.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-14T16:20:39.003Z
Answers.Text: I tried using searchkit but I don't think it is the right tool to do what I want. .Again, I already added field that already existed in CiviCRM to that tab but when I try with a custom field, it doesn't work
Answers.UserDisplayName: Anatole Allain
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-01T09:45:47.277Z
Answers.LastActivityDate: 2021-06-01T09:45:47.277Z
Answers.UserDisplayName: Aidan
Body: <p>I added a column in relationship tab, to do that I edited the civicrm/CRM/Contact/BAO/Relationship.php</p>
  <p>I already added columns with fields existing in the base of civicrm but now I'm trying to add a custom field of a custom group as a column.</p>
  <p>In the function makeURLClause() I don't know what to add in the select so it can select my custom field.</p>
  <p>the name of the custom group is civicrm_value_r_le_11
  the name of the custom value is fonction_dans_l_entreprise_83
  I tried <code>civicrm_civicrm_value_r_le_11.custom_83 as custom_83,</code> but it didn't work</p>
  
Tags: <custom-fields><database><relationships><column>
Title: Add a custom field as a column in relationship tab
ThreadText: # Add a custom field as a column in relationship tab
  
  (Asked by: username_0 on 2021-05-31)
  
  I added a column in relationship tab, to do that I edited the civicrm/CRM/Contact/BAO/Relationship.php
  
  I already added columns with fields existing in the base of civicrm but now I'm trying to add a custom field of a custom group as a column.
  
  In the function makeURLClause() I don't know what to add in the select so it can select my custom field.
  
  the name of the custom group is civicrm\_value\_r\_le\_11
  the name of the custom value is fonction\_dans\_l\_entreprise\_83
  I tried `civicrm_civicrm_value_r_le_11.custom_83 as custom_83,` but it didn't work
  
  **Tags:** custom-fields, database, relationships, column
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-06-01. Score: 2
  
  You really don't want to be modifying core files to do that. See [here](https://civicrm.stackexchange.com/q/39625/225) for a different approach.
  
  > **Comments:**
  > **username_0**: I tried using searchkit but I don't think it is the right tool to do what I want. .Again, I already added field that already existed in CiviCRM to that tab but when I try with a custom field, it doesn't work  
  
  ---
  
  