Sunday 22 August 2021

Custom Workflow Activities: How to access Pre and Post entity images

 

Custom Workflow Activities: How to access Pre and Post entity images



Can we use per and post entity in custom workflow ? 

I only found this blog. they use this pre and post business entity key. not tested. 

Dynamics CRM plugins allow in some events to register images which may be pre event or post event images whether they represent a copy of the context entity, before or after the core operation is performed, respectively.

https://msdn.microsoft.com/en-gb/library/gg309673.aspx#bkmk_preandpost

Images are only available for certain events:

http://crmbook.powerobjects.com/extending-crm/plug-in-development-and-workflow-extensions/plug-ins/plug-in-images-pre-vs-post/

Images are registered through the Plugin Registration tool. When registering an image is specified:

  • If is a pre image or post image;
  • Which context entity attributes it contains;
  • The name to get it inside the plugin.

The following image illustrates the registration of a pre image and a post image, for a plugin with a step on the post-operation of the account update, where each image contains only the account Name attribute.

register_images_plugin

The next image shows how to get the registered images inside the plugin.

 

plugin_images

With custom workflows activities there is not the possibility to register images, although the CRM “does it for us”, adding images to the custom workflow activity execution context depending on its stage.

The bellow table outlines all the events and stages where workflows can be executed and which images are available for each stage.

EventStage

(when the custom workflow activity is executed)

Image available (key )
When record is createdPre-event (*)
Post-event (Sync and Async)PostBusinessEntity
When record:

  • status changes;
  • is assigned;
  • fields change;
Pre-eventPreBusinessEntity
Post-event (Sync and Async)PreBusinessEntity

PostBusinessEntity

When record is deletedPre-eventPreBusinessEntity
Post-event (Sync) (*)
Post-event (Async)PreBusinessEntity

(*) (Stage not available to register real-time workflows)

Regarding to images in custom workflow activities:

  • Pre image is accessed through the PreBusinessEntity key;
  • Post image is accessed through the PostBusinessEntity key;
  • Both images contain all the attributes of the context entity.

The next image shows how to get both pre and post images, considering that the custom workflow activity is part of a workflow, running on the update event, asynchronously or synchronously after the entity is updated.

workflow_pre_post_images

1 comment:

  1. 888 Casino Resort Spa Announced for $12M Sale in
    888 Casino Resort Spa Announced for 아산 출장샵 $12M Sale in Palm Springs a 김포 출장마사지 $12M remodel of 토토 사이트 its 경상남도 출장안마 former home and spa rooms, including the 토토 사이트 모음 renovated

    ReplyDelete

Git Basic working