Answers.Body: <p>There is no hook or api specifically for writing to a field added to the civicrm_contact table, as that is a bad unsupported hack to core. I'd suggest changing your code to use the support provided for custom fields. That way you can be more confident that a code review of the extension won't end up preventing it from being published on civicrm.org for auto-distribution. If you still want to proceed with this bad pattern, then you might want to consider writing SQL and submitting it via db_query.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-11T05:34:22.833Z
Answers.Text: Thanks' Joe. At the end I have followed the way you suggest.
Answers.UserDisplayName: marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-11T21:04:37.977Z
Answers.Text: Great! FWIW, I'd appreciate having the answer marked as accepted and even upvoted ;)
Answers.UserDisplayName: Joe Murray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-09T16:07:27.867Z
Answers.LastActivityDate: 2016-04-09T16:07:27.867Z
Answers.UserDisplayName: Joe Murray
Answers.Body: <p>Use the post hook on the Contact entity.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-04T11:26:54.057Z
Answers.LastActivityDate: 2016-04-04T11:26:54.057Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>in my extension I have the need to manage a new contact information (I added a field in civicrm_contact, instead of using a custom field).
  Using the buildForm hook, I can show the input element in the contact form, but I don't know how to write the field value in the database.
  Is there a specific hook for this operation?</p>
  
  <p>Thanks
  Marcello</p>
  
Tags: <extension><database>
Title: Contact table: managing a new field
ThreadText: # Contact table: managing a new field
  
  (Asked by: username_0 on 2016-04-04)
  
  in my extension I have the need to manage a new contact information (I added a field in civicrm\_contact, instead of using a custom field).
  Using the buildForm hook, I can show the input element in the contact form, but I don't know how to write the field value in the database.
  Is there a specific hook for this operation?
  
  Thanks
  Marcello
  
  **Tags:** extension, database
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-04-09. Score: 2 | Accepted answer
  
  There is no hook or api specifically for writing to a field added to the civicrm\_contact table, as that is a bad unsupported hack to core. I'd suggest changing your code to use the support provided for custom fields. That way you can be more confident that a code review of the extension won't end up preventing it from being published on civicrm.org for auto-distribution. If you still want to proceed with this bad pattern, then you might want to consider writing SQL and submitting it via db\_query.
  
  > **Comments:**
  > **username_0**: Thanks' Joe. At the end I have followed the way you suggest.  
  > **username_1**: Great! FWIW, I'd appreciate having the answer marked as accepted and even upvoted ;)  
  
  ---
  
  ### Answer by username_2 on 2016-04-04. Score: 1
  
  Use the post hook on the Contact entity.
  
  
  ---
  
  