on 04-03-2009 1:34 PM
All,
Please help before I pull all my hair out I am updating a UDF in the EmployeeInfo.ReviewsInfo from a matrix
businessObject.ReviewsInfo.UserFields.Fields.Item("U_PRBComp").Value = source.GetValue("U_PRBComp", i);
I get the error 'The entered value does not match the specified field type' this field is just a string. and i am passing in a string
All other UDFs update correctly. if I step over this one.
SBO 2007 Patch 46
Any help would be great
Thanks
Paul Worthington
OK Still no joy
BoFieldTypes currentType = businessObject.ReviewsInfo.UserFields.Fields.Item("U_PRBComp").Type;
businessObject.ReviewsInfo.UserFields.Fields.Item("U_PRBComp").Value = "test";
When I check currentType it returns BoFieldTypes.db_Numeric, but in SBO it is set to Alphanumeric 20, and in SQL it is nvarchar(max)
How no idea what is going on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Paul,
use .toString() at the end of your input value:
businessObject.ReviewsInfo.UserFields.Fields.Item("U_PRBComp").Value = source.GetValue("U_PRBComp", i).ToString();
Hth
Regards Teun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
The Nvarchar(max) datatype is alphanumeric so there isn't a problem there.
Try using the Trim method on your datasource value:
businessObject.ReviewsInfo.UserFields.Fields.Item("U_PRBComp").Value = source.GetValue("U_PRBComp", i).Trim();
DBDatasources tend to get returned with a lot of extra spaces at the end of the value which can cause a problem.
If this doesn't work, try using SQL Profiler to see what value is actually being sent to SQL when you call the Update method.
Kind Regards,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK got a little bit further.
now know SBO thinks the field is numeric, found this by checking the fieldtypes checked the UDF in SBO set to alphanumeric size 20, database it is set to nvarchar(max).
Thanks
Paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.