A developer registers a pre-image on a PreOperation step for the Create message of the lead table so the plug-in can see the lead's values before they are saved. At runtime the PreEntityImages collection is always empty. What explains this behavior?
Select an answer to reveal the explanation.
Short Explanation
You can't take a before photo of something that doesn't exist yet. On Create there's no previous row, so there's no pre-image, period. Everything the caller sent is already sitting in Target, so read it there.
Full Explanation
A pre-image is a snapshot of the row as stored before the core operation. On the Create message there is no stored row before the operation, so Dataverse does not supply a pre-image at any stage, and a pre-image registration on Create provides nothing. The values the caller is submitting are available in the Target entity in InputParameters, which is where a PreOperation plug-in should read them and, if needed, modify them before they are saved. Moving the step to PostOperation does not create a pre-image; on Create a PostOperation step can receive a post-image of the newly created row, but the before state still does not exist. Filtering attributes apply only to Update steps and control whether the step fires; they do not populate images on any message. Asynchronous mode also does not create a pre-image; asynchronous steps run after the commit and can receive a post-image, but the concept of a prior row remains absent for Create. Exam caveat: pre-images are meaningful on Update and Delete, and on Delete the pre-image is often the only way to see the values of the row being removed. Operational check: remove the pre-image registration from the Create step, read the incoming columns from Target in the PreOperation code, and confirm in the trace log that the values appear.