Answers.Body: <p>Found out that entry can be accessed with <code>$this-&gt;element-&gt;owner</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-29T13:25:41.860Z
Answers.LastActivityDate: 2017-01-29T13:25:41.860Z
Answers.UserDisplayName: Yuri Salimovskiy
Body: <p>I have a custom fieldtype (used within Neo block) and I need to know the ID/content of entry it belongs to, when editing the entry.</p>
  
  <p>I need to both populate field values based on value in other field (if present) and also perform validation on save by comparing with other fields in same entry.</p>
  
  <p>So I need to know the entry content (or at least entry ID so I could fetch those) within <code>getInputHtml</code> and <code>validate</code> functions.</p>
  
  <p>I know I could use <code>$this-&gt;model</code> and <code>$this-&gt;element</code> but those don't seem to provide any data related to entry</p>
  
Tags: <plugin-development><custom-fieldtype>
Title: Get owner entry from fieldtype
ThreadText: # Get owner entry from fieldtype
  
  (Asked by: username_0 on 2017-01-24)
  
  I have a custom fieldtype (used within Neo block) and I need to know the ID/content of entry it belongs to, when editing the entry.
  
  I need to both populate field values based on value in other field (if present) and also perform validation on save by comparing with other fields in same entry.
  
  So I need to know the entry content (or at least entry ID so I could fetch those) within `getInputHtml` and `validate` functions.
  
  I know I could use `$this->model` and `$this->element` but those don't seem to provide any data related to entry
  
  **Tags:** plugin-development, custom-fieldtype
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-01-29. Score: 0 | Accepted answer
  
  Found out that entry can be accessed with `$this->element->owner`
  
  
  ---
  
  