Your question has been submitted and is awaiting moderation.
I need to be able to create a new user and set the value of a custom profile property. Please see my code below which creates the new user, sets the value of a default property (Biography) and also sets the value of my custom property (CRMContactID), however, the custom property value doesn't save. I have tried both UserController.UpdateUser() and ProfileController.UpdateUserProfile() to do the update but neither seem to work for me.
Any help would be very much appreciated. Thanks.
Dim objUserInfo As New UserInfo
.DisplayName = myFirstName & " " & myLastName
.Email = myEmailAddress
.FirstName = myFirstName
.LastName = myLastName
.Username = myEmailAddress
.IsSuperUser = False
.PortalID = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().PortalId
.Membership = New UserMembership(objUserInfo)
.Membership.Password = myPassword
.Membership.Approved = isApproved
.Membership.UpdatePassword = passwordUpdateRequired
Dim objCreateStatus As DotNetNuke.Security.Membership.UserCreateStatus = UserController.CreateUser(objUserInfo)
If objCreateStatus = DotNetNuke.Security.Membership.UserCreateStatus.Success Then
.Profile.Biography = "still testing"