True to its name, the
Created workflow evaluation setting only runs when a record is inserted. If your record doesn't meet the rule criteria by the time the workflow rule is evaluated, you've missed your chance.
If you are manually updating your target fields after they are inserted (or via workflow field update), then it should come as no surprise why a Workflow rule set to evaluate only when a record is created isn't being run (because that record has already been created, and you are now updating that previously created record.)
You can change fields in a
Before Insert trigger on
Opportunity to set your two fields to meet your workflow's rule criteria, and the workflow rule will still run.
I'm not so sure if it'll work if you have an
Opportunity trigger that then calls a
Opportunity trigger. Technically, it's in the same transaction as the insert, and would end up being run before workflow rules are evaluated. I'm afraid I don't have time to test if this works right now.
According to comments, you are accomplishing this update (of team lead email) via Process Builder. I don't have much experience with processes, but I think I've read enough to help out here.
If you take a look at the Salesforce Order of Operations, Processes (built via Process Builder) run after triggers and after workflow rules.
That means that your update to the field occurs too late for a workflow rule, that only runs on record creation, to be able to use it. My understanding is that a process field update will cause triggers to fire again, but at that point it is no longer considered running on record creation, but rather on an update of the record (this explains why changing the evaluation criteria to
Created, and every time it's edited to subsequently meet criteria works).
Your options to work around this are
- stop using process builder, and do this field update in a
Before Insert trigger
- remove the workflow rule you currently have and make it part of your
process. Create a flow to send your email alert, and execute your flow as an immediate action in your process