You need to sign in to do that
Don't have an account?
UPSERT casted string to Double always put '0' PLEASE HELP
Private Sub UpsertToSalesForce(ByVal OwnerId As String, _
ByVal Sell_In_Total__c As String, _
ByVal Sell_Through_Total__c As String, _
ByVal Sell_In_Goal__c As String, _
ByVal Sell_Through_Goal__c As String, _
ByVal strExternalID__c As String)
Dim sforce As New sforce.SforceService
Dim ur As sforce.UpsertResult()
Dim recordsToUpdate As sforce.sObject()
Dim aryList As System.Collections.ArrayList
aryList = New ArrayList()
Dim i As Integer
Dim revenue As New sforce.TH_Revenue_Totals__c
revenue.OwnerId = OwnerId
'revenue.Sell_In_Total__c = CType(Sell_In_Total__c, Double)
'revenue.Sell_Through_Total__c = CType(Sell_Through_Total__c, Double)
revenue.Sell_In_Total__c = CDbl(Sell_In_Total__c)
revenue.Sell_Through_Total__c = CDbl(Sell_Through_Total__c)
revenue.Sell_In_Goal__c = Sell_In_Goal__c
revenue.Sell_Through_Goal__c = Sell_Through_Goal__c
revenue.ExternalID__c = strExternalID__c
aryList.Add(revenue)
recordsToUpdate = aryList.ToArray(GetType(sforce.sObject))
Try
ur = binding.upsert("ExternalID__c", recordsToUpdate)
For i = 0 To ur.Length - 1
If ur(i).success Then
Console.WriteLine("Upsert is Successful..." & "Status: " & ur(i).created)
Else
Console.WriteLine("Upsert failed, id: " & ur(i).id())
End If
Next i
Catch ex As Exception
Console.WriteLine("Error in: " & "UpsertToSalesForce(): " & ex.Message)
Finally
End Try
End Sub
revenue.Sell_In_Total__cSpecified = true
and the same for the other double fields.
IT WORKS !!!!
Thank you very much!!!!!