You need to sign in to do that
Don't have an account?
mandy
Updating Sforce currency field problem
Hello,
I'm struggling to update a currency field in Salesforce. Here is my code:
-------------------------------------------------------------------------------------------------------
Dim o As SalesForceAPI.Opportunity = New SalesForceAPI.Opportunity
o = opp
o.Actual_Revenue__c = CDbl(revenueRow.SUM_RECEIVED)
Dim sr As SalesForceAPI.SaveResult() = sforce.update(New SalesForceAPI.sObject() {o})
For d As Integer = 0 To sr.GetUpperBound(0)
If sr(d).success Then
Console.Write("Success")
Else
Console.Write(sr(d).errors(0).message.ToString & vbCrLf)
End If
Next d
-------------------------------------------------------------------------------------------------------
I tried hard-coding a number in place of revenueRow.SUM_RECEIVED in the above code for debugging purposes but that did not work either.
If I change the sforce field type to text and remove "CDbl" from the above code the update works perfectly. Any advice how I can insert a numeric value into the currency field, Actual_Revenue__c?
Thank you in advance for your help!
Mandy
I'm struggling to update a currency field in Salesforce. Here is my code:
-------------------------------------------------------------------------------------------------------
Dim o As SalesForceAPI.Opportunity = New SalesForceAPI.Opportunity
o = opp
o.Actual_Revenue__c = CDbl(revenueRow.SUM_RECEIVED)
Dim sr As SalesForceAPI.SaveResult() = sforce.update(New SalesForceAPI.sObject() {o})
For d As Integer = 0 To sr.GetUpperBound(0)
If sr(d).success Then
Console.Write("Success")
Else
Console.Write(sr(d).errors(0).message.ToString & vbCrLf)
End If
Next d
-------------------------------------------------------------------------------------------------------
I tried hard-coding a number in place of revenueRow.SUM_RECEIVED in the above code for debugging purposes but that did not work either.
If I change the sforce field type to text and remove "CDbl" from the above code the update works perfectly. Any advice how I can insert a numeric value into the currency field, Actual_Revenue__c?
Thank you in advance for your help!
Mandy
o.Actual_Revenue__cSpecified = true
so that .NET will actually send that value over the wire.
All Answers
o.Actual_Revenue__cSpecified = true
so that .NET will actually send that value over the wire.