+ Start a Discussion

SaveResults.errors.fields collection is empty

After attempting to save an sobject that contains a field with invalid data (for example, a null value on a boolean field), I get, as expected, a save results collection that contains "success=false". I also get, as expected, an errors collection for each invalid sobject.

The error object contains a statusCode property of "INVALID_TYPE_ON_FIELD_IN_RECORD", which is lovely. It even contains a message property of "MyFieldLabel: value not of required type: null", which is great.

The error object also has a fields string array, which has one element, because there is one errant field. The problem is that this element is null, rather than "MyFieldLabel". Is this not intended to contain the name of the field containing invalid data?

This is with API 5.0.

Any clues would be much appreciated.
The docs for fields says:

"Reserved for future use. "

We haven't made use of this yet, so it will always be null. I hope that in the future, we'll be able to fill this in.