Reply
Regular Contributor
Sidharth
Posts: 137
0
Accepted Solution

Insert Null Values into Salesforce

Hello All

 

I have a outside application build on C# which accesses my Salesforce DB.

When i try to insert NULL values form C# app to SF, it doesnt effect anything. 

I have defined my variables in C# app as Nullable, and can see that its sending NULL values, but still no effect in SF.

 

Any ideas?

 

Thanks

Sid

Business System Developer
Moderator
SimonF
Posts: 7,984
0

Re: Insert Null Values into Salesforce

You need to use the fieldsToNull property on SObject, e.g. to set field "foo__c" to null, you'd do

 

Account a = new Account();

a.Id = 'someId';

a.fieldsToNull = new String [] { "Foo__c" };

SaveResult sr = stub.update(new SObject [] {a});

Cheers
Simon
docs | blog | twitter
Regular Contributor
Sidharth
Posts: 137
0

Re: Insert Null Values into Salesforce

Thanks a lot :)

Business System Developer