There is a common misconception with workflow trigger criteria of created, and any time it’s edited to subsequently meet criteria
The key here is edited to subsequently meet criteria
which really means that before the update, the record didn't meet the criteria.
For example, if a workflow rule should fire when amount > 10, and the Opportunity is created with amount = 5, then updated to amount = 15 and then updated again to amount = 20, the workflow fires only once (when amount = 15). It won;t fire again until the amount is changed to something <=10, then changed again to something > 10.
If you are using a filter of Opportunity Name contains "Value"
, then before the API update, the Opportunity Name must not contain the string "Value"
A couple of other things to check:
- Your API update of the Opportunity actually succeeds without any exception
- You are not simulating the API via a testmethod - email messages will never be sent in testmethods.
- Look in the debug log in the workflow trace - you can see what values are passed to the workflow rule from the SObject Opportunity. Perhaps you have additional conditions in the workflow rule that prevent rule execution