I’m stuck with this old problem but i can’t solve it. When i call a method onĀ CoreProperty object to alter user data then a error is raised saying that only a user with privileges can do that.
I’m usingĀ SPSecurity.RunWithElevatedPrivileges delegate with all kind of suggestions that i found on internet about set context to null but nothing works. Anybody can help me with that? I’m using SharePoint 2013 Server. Thanks in advance.
I found a solution Ajeet thanks, instead of usingĀ
ProfileSubtypeProperty workPhone = subtypePropMgr.GetPropertyByName(“WorkPhone”);
CoreProperty coreWorkPhone = workPhone.CoreProperty;
coreWorkPhone.DisplayName = txtWorkPhone.Text;
coreWorkPhone.Commit();
to update a property i’m using the code bellow and now its works
UserProfile userProfile = userProfileMgr.GetUserProfile(accountName);
userProfile[“WorkPhone”].Value = txtWorkPhone.Text;
Thanks for the help