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
VidhyaVidhya 

Unable to update Oppty Amount field using Enterprise wsdl

I downloaded the Enterprise WSDL from SF and consuming it in .Net application.
I am trying to update an Opportunity Name & Amount.
What I have observed is,

When the initial opp Amount value is blank, when .net app is run, only Opp Name gets updated., Amount field is still blank.
When the initial opp Amount value is not blank, when .net app is run, both Opp Name & Amount fields gets updated.

 

I would like to know, why the amount is not getting updated when the old value is blank.
I am not able to find any documentation for the same.
Am I missing anything?

 

Code:

Opportunity opp = (Opportunity)queryResults.records[0];

Console.WriteLine("Name: " + opp.Name + " - Stage :" + opp.StageName + " - Amount : " + opp.Amount);

opp.Name = "Oppty_Name_Test13";          // old value - "OppTest13"  -> gets changed to new value when run
opp.Amount = 12345.00;                          // old value blank -> no change, still shows blank after run

SaveResult[] saveResults = binding.update(new sObject[] { opp });

 

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

because your not setting the amountSpecified flag to true, see the sticky post at the top of this forum.

All Answers

SuperfellSuperfell

because your not setting the amountSpecified flag to true, see the sticky post at the top of this forum.

This was selected as the best answer
VidhyaVidhya

Thanks a lot Simon!! That did work.