Custom Workflow Activities: How to access Pre and Post entity images
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:
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.
The next image shows how to get the registered images inside the plugin.
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.
Event | Stage (when the custom workflow activity is executed) | Image available (key ) |
When record is created | Pre-event (*) | — |
Post-event (Sync and Async) | PostBusinessEntity | |
When record:
| Pre-event | PreBusinessEntity |
Post-event (Sync and Async) | PreBusinessEntity PostBusinessEntity | |
When record is deleted | Pre-event | PreBusinessEntity |
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.
888 Casino Resort Spa Announced for $12M Sale in
ReplyDelete888 Casino Resort Spa Announced for 아산 출장샵 $12M Sale in Palm Springs a 김포 출장마사지 $12M remodel of 토토 사이트 its 경상남도 출장안마 former home and spa rooms, including the 토토 사이트 모음 renovated