mulesoft/salesforce-connector — Issue #20: Support for null values with bulk api
Author: jonathansnd
Created: 2012-01-06 00:45:40+00:00
State: open

It looks like null values are not supported, they're actually throwing a null pointer exception when calling the toString method from the following method inside the Salesforce Module class:

'''java
private com.sforce.async.SObject toAsyncSObject(Map map) {
com.sforce.async.SObject sObject = new com.sforce.async.SObject();
for (String key : map.keySet()) {
sObject.setField(key, map.get(key).toString());
}
return sObject;
}
'''
Bulk API works a little bit different with null values, you actually need to set the nil property to true:

>Fields that aren't defined in the XML for a record are ignored when you update records. To set a field value to null, set the xsi:nil >value for the field to true. For example, sets the description field to null.

I'd be nice for developers to set a null value on their objects and have Salesforce save the correct data type or at least avoid a Null pointer exception.