Call to SPGetFieldValue returns 0 on invalid FieldName.
Call to SPGetFieldValue returns 0 on invalid FieldName.
Making a call to SPGetFieldValue passing "" or even "nonsense" for chFieldName parameter returns 0 as the result. According to the documentation it should return a result < 0. Has this changed and not been updated in the documentation? Is there a way to know if a field name is invalid compared to a valid one that has an empty string as the value?
-
- Posts: 16
- Joined: Mon Oct 06, 2008 9:29 am
Re: Call to SPGetFieldValue returns 0 on invalid FieldName.
The documentation is wrong for that function. SPGetFieldValue returns the length of the data in the field. If you pass in a bad field name it will return zero. I'll put a bug in to get that fixed so that the API returns < 0 value for a bad field name.
SPSetFieldValue (on the other hand) will return an error if you pass in a bad field name.You will get a -104 error code in that scenario.
SPSetFieldValue (on the other hand) will return an error if you pass in a bad field name.You will get a -104 error code in that scenario.
Gil McNeill
SoftPro Software Engineer
SoftPro Software Engineer