cancel
Showing results for 
Search instead for 
Did you mean: 

UDF Not storing Value

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hello Paul,

Remove the udf create a new one. If the types are still different, log a message at SAP support.

Hth

Regards Teun

Former Member
0 Kudos

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

former_member201110
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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