Retrieve and Update Custom Profile Type given to a User
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
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"
);