How to add new field to User Object in CS Profile System
Purpose of the Article
To demonstrate how to add a new field the USER object in profile system of Microsoft Commerce server.
Aim
To add a new field named as “EmployeeRole”. It should have a list of values from which the user has to select the desired one.
Environment Used
-
Microsoft Commerce Server 2009
-
Microsoft SQL Server 2008
-
Microsoft Windows Server 2003
Small background information
The User object is a part of Profile system in Commerce server. It is the responsible part to keep all the site related User information. Commerce server by default has embedded with some fields in the user object. So when we need an additional field we have to add them manually using the Commerce Server Manager.
Assumption
There is sufficient rights available with the windows logged in user to open the Customer and Orders Manager and Commerce Server Manager.
Steps
Open Customer and Orders Manager from the Start > Microsoft Commerce Server 2009

Now we can view the Customer and Orders Manager. Choose Site Terms from the left hand Views panel. Click on Create New Site Term in Tasks panel.

The Create New Site Term dialog will appear to enter the data. Specify the Names, Display Name and Description in the desired places. In the Values panel add the values from which the User has to select the required one while entering the User Data. Then Save & Close the dialog.

Now we have finished with specifying the list of values to be selected in EmployeeRole field. The next step should be to create the field in the User object and to map it with the Site Term.
Open Commerce Server Manager from Start > Microsoft Commerce Server 2009

Expand the profile manager of the site in which we have added the site terms. In the image below NirmalMindfire is the site. Choose the User Object from the tree as shown in the image and right click on it.

Click on New Data Member to add a new data member to the User Object. The new data member dialog will appear and fill the required field to create a new data member named as “EmployeeRole”. Then click on Add and Finish.

Now we have the field in database. We need to map this DB field with the commerce server User Object.
Climb up in the tree. Go to Profile Definitions. Choose User Object to view the object editor in the right hand pane. Double click on the General Information to expand. Click on the Add button to add a new property. The dialog will appear. Choose Add a New Property option from the dialog and click OK.

Now we can see the property appeared in the screen under general information with a new name called New Property 1. Click on the property. We can find a property editor in the right hand panel. Fill the fields in the Attributes panel. Click on Type reference to map the site term EmpRoles created in Customer and Orders Manager previously.

Click on the Advanced Attribute to expand. Click on Map To Data to find out the newly added field to map. We will get the Data Source Picker dialog to choose the field. Expand the ProfileService-SQLSource > UserObject node and select the EmployeeRole field from the list. Press Ok.

Click on Apply to apply the new property.
Now we have the new property applied our User Object. The employee role that is going to be chosen by the user must be a value belongs to the site term values in EmployeeRole.
Conclusion
This article only demonstrates adding a field. Other desired fields can be added accordingly with the required settings and data types chosen. The screen appearance and user defined captions may vary depending on the site name, Commerce server version and the operating system.