+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Retrieve and Update Custom Profile Type given to a User

Retrieve and Update Custom Profile Type given to a User

2 posts, 0 answered
  1. Aby
    Aby avatar
    5 posts
    Registered:
    16 May 2013
    11 May 2015
    Link to this post

    Hi all,

     I have created a new profile type for users called "Vendor" and in it I have defines a "Yes/No" field called "FeaturedUser". I have been trying out a lot of methods which I came across in many blogs and forums but it says

     "Wrong custom field 'FeaturedVendor' for type 'Telerik.Sitefinity.Security.Model.SitefinityProfile'"

    Following is the code that I have used:

     

     UserProfileManager profManager = UserProfileManager.GetManager();
     var profile = profManager.GetUserProfile(ClaimsManager.GetCurrentUserId(),typeof(SitefinityProfile).FullName);
     var value = DataExtensions.GetValue(profile, "FeaturedVendor");​

     

    Am I missing something or am I doing it the wrong way?

     

    The version of Sitefinity is 7.0

  2. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    08 Dec 2016
    14 May 2015
    Link to this post
    Hello Aby,

    You said that your custom profile is called Vendor and your field is called FeaturedUser. As far as I can see from the provided code sample you are trying to get the value of FeaturedVendor field, but not for FeaturedUser.

    UserProfileManager profManager = UserProfileManager.GetManager();
     var profile = profManager.GetUserProfile(ClaimsManager.GetCurrentUserId(),typeof(SitefinityProfile).FullName);
     var value = DataExtensions.GetValue(profile, "FeaturedVendor");​

    If there is no field with such name available it is pretty normal to receive this error.

    Regards,
    Kaloyan
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered