Custom User Fields - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Custom User Fields

  • Custom User Fields
  • I followed the steps outlined here
    docs.sitefinity.com/for-developers-create-user-profiles
    as well as www.sitefinity.com/.../adding-custom-attributes-to-users

    I added a PhoneNumber, Region, Brand, and Comment field to the default user profile. All but Comment were short text type.

    I basically copied the registration controller and registratioviewmodel code from the Feather github page and tweaked them for my purposes. For the normal fields in the SitefinityProfile class it's working fine. However calling DoesFieldExist on the profile instance with values of "PhoneNumber", "Region", "Brand" or "Comment" returns false. Attempting to set the values anyway fails with an error of type System.NotSupportedException: 'Type 'Telerik.Sitefinity.Security.Model.UserProfile' does not contain property with name 'PhoneNumber'.' I can set them manually in the admin screen so I know that they exist. I just can't seem to find a way to access them in a widget.

    Is there something else I need to do? None of the code samples indicate any other actions or code that I might need to write.

    We're running Sitefinity 10.0
  • Please help! We are running into the same issue with version 10 for the Profile created event in the global.asax

    var externalProviderName = eventInfo.Profile.User.ExternalProviderName;
    if (externalProviderName == "someval")

    eventInfo.Profile.SetValue("someVal", "true");

    And yes, "someVal" was created as a custom profile field