Skip to content
Charles Llamas

How to access Pre and Post entity images in a Custom Workflow Activity

1 min read

This post is only available in English.

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.

Reference: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/workflow/workflow-extensions#entity-images-for-workflow-extensions

Related posts

Comments

No comments yet

No comments yet. Yours would be the first.

Leave a comment

Never published. Only used if I need to reply to you.

← All posts