function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PuzzledPuzzled 

Having trouble nulling fields with VB.NET and Partner WSDL

I'm having a problem trying to null some numeric fields in a very simple piece of code using the Partner WSDL.
 
The update call gets made, takes a little time that's observable in debug mode, and throws an error that gets handled by the Catch statement.  The error message is blank, so no help there.  I can't look at the sr.success value, sr is undefined.
 
I read through the forum and saw some references to setting the "updated" property of the field as true (or maybe even false) but I don't know how to do that and other references I found didn't show that property needing to be set.  The Enterprise WSDL shows all the fields I'm working with as nillable.
 
fieldnames is an array of internal field names, all fields contain currency data, only one field name is in there currently
acctid is the account id

        Try
            Dim ClearCharge As sforce.sObject = New sforce.sObject
            ClearCharge.Id = acctid
            ClearCharge.fieldsToNull = fieldnames
            Dim sr As sforce.SaveResult = binding.update(New sforce.sObject() {ClearCharge}) (0)
 
            If Not sr.success Then
                TextBox2.Text = "Account: " & acctid & "   Message: " & sr.errors(0).message
            End If
 
        Catch E As Exception   'when the field isn't there
            TextBox2.Text += vbCrLf & "Error on call - " & E.Message
        End Try
 
 
Any ideas?  I'm really stumped here!

Message Edited by Puzzled on 08-05-2006 06:20 PM

SuperfellSuperfell
You haven't set the type property on the sObject.
PuzzledPuzzled
Duh!
 
Thank you so much!  It works now.