For workflow extensions entity images are available using the key values PreBusinessEntity and PostBusinessEntity respectively for the pre and post entity images.
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
public class SampleCustomActivity : CodeActivity
{
protected override void Execute(CodeActivityContext executionContext)
{
// Get the context service.
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
Entity preImage = context.PreEntityImages["PreBusinessEntity"];
Entity preImage = context.PreEntityImages["PostBusinessEntity"];
}
}
Note: PreBusinessEntity and PostBusinessEntity only works if the Workflow is a real-time workflow.
New Comment