Body: <p>I have altered the Craft usermodel using some standard field types (like an entry field type) and an customfieldtype (extended from the EntriesFieldType). The only thing I have altered in the child fieldtype is some validation rules and the prepValue method. I dont get any errors saving this new field type but when I try to access it eg: </p>
  
  <pre><code>    $lCurrentUser = craft()-&gt;userSession-&gt;getUser();
      $lCompanyIdUser1 = $lCurrentUser-&gt;companiesDropdown[0]-&gt;id;
      $lCompanyIdUser2 = $lCurrentUser-&gt;companyUser[0]-&gt;id;
  </code></pre>
  
  <p>companiesDropdown is a standard "Craft" Entries fieldtype 
  companyUser is the custom fieldType </p>
  
  <p>the error is get is : 
  Undefined property: Craft\UserModel::$companyUser (i've tripple checked the handle name)</p>
  
  <p>Please advise,</p>
  
  <p>Thanks in advance. </p>
  
  <p>(ps I'm running Craft 2.2) </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-03T15:53:02.290Z
Comments.Text: Are you sure you've added that exact field to your user profile field layout?
Comments.UserDisplayName: Brandon Kelly
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-04T06:07:49.283Z
Comments.Text: Yes, And I can use it. Meaning I can drag in an entry and it saves successfully. And I also see it in a var_dump on the user object
Comments.UserDisplayName: pythic
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-04T11:21:56.237Z
Comments.Text: I'm not really sure why it wouldn't be working. Can you send a DB backup and your plugin to support@buildwithcraft.com? I can look into it from there.
Comments.UserDisplayName: Brandon Kelly
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-06T12:37:23.700Z
Comments.Text: May be its because I try to do the above in the prepValue method. I think ->companyUser is not known at that time yet. If I execute the same in the validate method upon saving I can access this fieldType. Does that make sense?
Comments.UserDisplayName: pythic
Tags: <fieldtypes><custom-fieldtype>
Title: Custom field type not accessible in usermodel
ThreadText: # Custom field type not accessible in usermodel
  
  (Asked by: username_0 on 2014-09-03)
  
  I have altered the Craft usermodel using some standard field types (like an entry field type) and an customfieldtype (extended from the EntriesFieldType). The only thing I have altered in the child fieldtype is some validation rules and the prepValue method. I dont get any errors saving this new field type but when I try to access it eg:
  
  ```
      $lCurrentUser = craft()->userSession->getUser();
      $lCompanyIdUser1 = $lCurrentUser->companiesDropdown[0]->id;
      $lCompanyIdUser2 = $lCurrentUser->companyUser[0]->id;
  
  ```
  
  companiesDropdown is a standard "Craft" Entries fieldtype
  companyUser is the custom fieldType
  
  the error is get is :
  Undefined property: Craft\UserModel::$companyUser (i've tripple checked the handle name)
  
  Please advise,
  
  Thanks in advance.
  
  (ps I'm running Craft 2.2)
  
  **Tags:** fieldtypes, custom-fieldtype
  
  > **Comments:**
  > **username_1**: Are you sure you've added that exact field to your user profile field layout?  
  > **username_0**: Yes, And I can use it. Meaning I can drag in an entry and it saves successfully. And I also see it in a var_dump on the user object  
  > **username_1**: I'm not really sure why it wouldn't be working. Can you send a DB backup and your plugin to support@buildwithcraft.com? I can look into it from there.  
  > **username_0**: May be its because I try to do the above in the prepValue method. I think ->companyUser is not known at that time yet. If I execute the same in the validate method upon saving I can access this fieldType. Does that make sense?  
  
  ---
  
  ## 0 answers
  
  