locked
[Plugin] Incomplete entity from InputParameters RRS feed

  • Question

  • Hi,

    I'm writing a plugin that I registered as a Post-Operation Synchronous step on the Update systemuser message. There's also an Image associated to that step since I want to compare the system user before and after modification.

    In the plugin, I get the transformed object via context.InputParameters["Target"] and the old one with (Entity)_executionContext.PreEntityImages["ImageName"].

    It turns out that, while both of them are of the type Entity, the former is an object with only 5 items in its Attribute collection

    SystemUser Attributes :

    title
    systemuserid
    modifiedon
    modifiedby
    modifiedonbehalfby


    whereas the Pre Image object has 46 attributes.

    The attribute I'm interested in - businessunitid - is not in the Target, so I cannot know if it changed.

    - Is it normal that InputParameters objects only have that few Attributes populated off the bat? Is it because only the attributes that changed are present?

    - Why the difference with PreEntityImages?

    Thanks



    • Edited by GuillaumeL31 Monday, September 18, 2017 12:52 PM
    Monday, September 18, 2017 12:48 PM

Answers

  • Hello,

    Target contains only attributes that were changed.

    PreEntityImage can contain all the attributes that you define during configuration of image.


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Monday, September 18, 2017 1:44 PM
    Moderator

All replies

  • Hello,

    Target contains only attributes that were changed.

    PreEntityImage can contain all the attributes that you define during configuration of image.


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Monday, September 18, 2017 1:44 PM
    Moderator
  • That works as you explained, thanks. It wasn't obvious from the docs and I couldn't find any resource that stated it clearly.

    Guillaume


    Monday, September 18, 2017 3:23 PM