Hi, I've got a weird problem...
I've added two custom profile fields. When I specify the values through the web user interface, I have no problems. However, when I specify them through the UserManagementWebService, and then try to view the users in Checkbox, I get an error
Code:
An application error occurred.
Error Message: Unable to cast object of type 'System.Int32' to type 'System.String'.
Source: App_Web_edituser.aspx.70ab9a11
Target Site: Void LoadCustomUserInfo()
URL: http://survey.education.co.uk/Users/EditUser.aspx
Referrer: http://survey.education.co.uk/Users/ManageUsers.aspx?userCreated=true
User Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)
User Host Name 192.168.1.41
User Host Address 192.168.1.41
Stack Trace: at CheckboxWeb.Users.EditUser.LoadCustomUserInfo()
at CheckboxWeb.Users.EditUser.LoadUserProfile()
at CheckboxWeb.Users.EditUser.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at CheckboxWeb.AuthPage.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
In the tables, the values *seem* to be set correctly;
ckbx_CustomUserField
Code:
CustomUserFieldID CustomUserFieldName Position IsDeletable Hidden
2 ContactID 2 0 0
3 EducationNumber 3 1 0
1 Email 1 0 0
ckbx_CustomUserFieldMap
Code:
UniqueIdentifier CustomUserFieldID Value
jamesb 1 jamesb@education.co.uk
tapmantwo@hotmail.com 2 C99
tapmantwo@hotmail.com 3 123
jamesb 3 123
jamesb 2 C99
tapmantwo@hotmail.com 1 jamesb@education.co.uk
richard.tappenden@btopenworld.com 2 C232
richard.tappenden@btopenworld.com 3 325897
richard.tappenden@btopenworld.com 1 richard.tappenden@btopenworld.com
test 2 c1
test 3 012
test 1 a@b.c
Users jamesb & test shows fine - the others do not (both were entered manually into checkbox).
I can't see any other differences?
For reference, my code to create the user is as follows;
Code:
Dim profileProps(2) As Checkbox.SimpleNameValueOfObjectObject
profileProps(0) = New Checkbox.SimpleNameValueOfObjectObject
profileProps(0).Name = "ContactID"
profileProps(0).Value = registration.ContactID
profileProps(1) = New Checkbox.SimpleNameValueOfObjectObject
profileProps(1).Name = "EducationNumber"
profileProps(1).Value = registration.EducationNumber
profileProps(2) = New Checkbox.SimpleNameValueOfObjectObject
profileProps(2).Name = "Email"
profileProps(2).Value = registration.EmailAddress
Dim addedToCheckBox As Boolean = False
Try
Dim checkboxResult As String = checkBoxWS.CreateUser(authToken.Value, registration.UserName, registration.Password, profileProps, True)
addedToCheckBox = True
Catch ex As Exception
addedToCheckBox = False
End Try
In my developer version, it all works fine!?
I'd appreciate any help I can get please.