04-23-04 03:46 PM
Hi Jason,
I had the same problem, added new fields to the userobject, etc... The save(
) method does know of these new fields because the Microsoft.Solutions.Frame
work was coded only for these default fields of the Adventure works site.
What I did was instead of calling SetProfileProperties(userprofile) I commen
ted this line and added the following code below:
AuthenticationInfo authInfo = CommerceContext.Current.AuthenticationInfo;
ProfileContext profContext = CommerceContext.Current.ProfileSystem;
Profile userprof;
userprof = profContext.CreateProfile(this.LogonName, "UserObject");
userprof.Properties["GeneralInfo.logon_name"].Value = this.LogonName;
userprof.Properties["GeneralInfo.user_security_password"].Value = this.P
assword;
userprof.Properties["AccountInfo.org_id"].Value = sOrgID;
userprof.Properties["GeneralInfo.first_name"].Value = this.FirstName;
userprof.Properties["GeneralInfo.last_name"].Value = this.LastName;
userprof.Properties["GeneralInfo.email_address"].Value = this.EmailAddre
ss;
userprof.Properties["AccountInfo.account_status"].Value = 1;
userprof.Properties["AccountInfo.date_registered"].Value = DateTime.Now;
userprof.Properties["GeneralInfo.u_Cargo"].Value = CargoTextBox.Text; //
/ New fields that where added to the userobject
userprof.Properties["GeneralInfo.u_Departament"].Value = DepartamentText
Box.Text; /// New fields that where added to the userobject
userprof.Properties["GeneralInfo.user_title"].Value = TitleTextBox.Text;
userprof.Properties["GeneralInfo.tel_number"].Value = this.PhoneNumber;
userprof.Properties["GeneralInfo.fax_number"].Value = this.FaxNumber;
userprof.Properties["GeneralInfo.user_id_changed_by"].Value = Request.Se
rverVariables[ "AUTH_USER" ];
userprof.Properties["GeneralInfo.user_type"].Value = 1;
userprof.Properties["BusinessDesk.partner_desk_role"].Value = 1;
userprof.Update();
And instead of using save() you use update()
Hope this helps.
[ Post a follow-up to this message ]
|