locked
CRM 2011: Using postentity image in custom workflow activity RRS feed

  • Question

  • Hi all,

    Would anybody please provide me with samples that describe using pre/post entity images in custom workflow activity in order to use them to access current record values in custom workflow activity ?

    Thanks and best regards..


    Friday, January 4, 2013 9:59 PM

Answers

  • I decided that in the absence of conclusive evidence to the contrary, I would write some code to verify the usage or otherwise of Pre/Post Entity Images in Custom Workflow Activities.

    It turns out that your intuition was correct, Mostafa.  The CRM utilises the Images to store copies of the Entity attributes before and after the operation that triggered the Workflow.

    I have blogged my results in the following:

    http://pogo69.wordpress.com/2013/01/06/using-preentityimages-and-postentityimages-in-custom-workflow-activities/

    NB: As per the warnings in my blog post, this mechanism is undocumented in the SDK and is therefore, unsupported and subject to change at any time.  But for now, it does provide a convenient mechanism to access pre and post operation attribute values.


    --pogo (pat) @ pogo69.wordpress.com

    Saturday, January 5, 2013 10:08 PM

All replies

  • Images are registered against steps which are, in turn, registered against plugins.  No such facility exists for Custom Workflow Activities, as steps are irrelevant.

    If you need access to the current values of entity attributes in a custom workflow activity, you must execute a query for the data.


    --pogo (pat) @ pogo69.wordpress.com

    Saturday, January 5, 2013 12:44 AM
  • Are you sure ? So what is the need of the PostEntityImages/PreEntityImages properties in IWorkflowContext object ?
    Saturday, January 5, 2013 12:47 AM
  • PostEntityImages and PreEntityImages is inherited from IExecutionContext.  IPluginExecutionContext (the context provided to plugin assemblies) also inherits from the IExecutionContext base interface.

    While the Image collection members are available to both via interface inheritance, they are of no use within a Custom Workflow Activity as there is no mechanism to populate them.


    --pogo (pat) @ pogo69.wordpress.com

    Saturday, January 5, 2013 1:02 AM
  • Although workflow internally use images but we can not register them externally, as there is now way to do as said by pogo.


    Contact Me
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Saturday, January 5, 2013 7:00 AM
    Moderator
  • Although workflow internally use images but we can not register them externally, as there is now way to do as said by pogo.

    And what is the use of images in custom workflow activities ?
    Saturday, January 5, 2013 3:54 PM
  • I decided that in the absence of conclusive evidence to the contrary, I would write some code to verify the usage or otherwise of Pre/Post Entity Images in Custom Workflow Activities.

    It turns out that your intuition was correct, Mostafa.  The CRM utilises the Images to store copies of the Entity attributes before and after the operation that triggered the Workflow.

    I have blogged my results in the following:

    http://pogo69.wordpress.com/2013/01/06/using-preentityimages-and-postentityimages-in-custom-workflow-activities/

    NB: As per the warnings in my blog post, this mechanism is undocumented in the SDK and is therefore, unsupported and subject to change at any time.  But for now, it does provide a convenient mechanism to access pre and post operation attribute values.


    --pogo (pat) @ pogo69.wordpress.com

    Saturday, January 5, 2013 10:08 PM