When a project row is created, a plug-in must create five milestone rows, each with a lookup to the new project. Which stage gives the plug-in the new project's ID, and where does it read it?
Select an answer to reveal the explanation.
Short Explanation
You can't address mail to a house that hasn't been built yet. After the core create runs, PostOperation hands you the new ID in OutputParameters, and then you can wire up the milestones. And don't reach for a pre-image on Create; there's nothing before a create to take a picture of.
Full Explanation
The ID of a newly created row is generated by the core create operation unless the caller supplies one. After MainOperation runs, the Create message's response includes the ID, which a PostOperation step reads from OutputParameters with the key id. Because synchronous PostOperation runs inside the same transaction, the milestone creates commit or roll back together with the project. In PreOperation, Target.Id is empty unless the caller set it explicitly, so code relying on it fails for ordinary creates. PrimaryEntityId in PreValidation is likewise empty for a create, because no row exists yet. Pre-images capture the row's state before the operation, which does not exist for Create, so pre-images are not available on that message. Exam caveat: post-images are available on Create in PostOperation and can supply other column values, but the ID is most directly read from OutputParameters. Operational check: register the step on Create at PostOperation, log the value of OutputParameters id in plug-in trace logs, create a project, and confirm five milestones reference it.