Search code examples
pluginsdynamics-crmdynamics-365

Trigger a plugin step on "entityimage" change


I created a plugin that should upload the contact entity "entityimage" to an external storage.

The code itself should works (it works as a console app), but I am unable to add a step that trigger on "entityimage" change as I can't find it in the filtering attribute list in the Plugin Registration Tool.

Is there a way to trigger this plugin only when "entityimage" change?

Regards,

Dremor


Solution

  • Reviewing the Contact's entityimage field in the Metadata Browser indicates that it is a "Virtual" field, which may be why it is unavailable as a filtering attribute.

    Also, according to the SDK there does not appear to be any other message available besides "Update" on the Contact that could be used to indicate that the entityimage has changed.

    And, changing the image through the UI does create an Audit History entry, however, it is a generic "Update" entry, with the old value and new value blank.

    It appears that triggering a plugin on change of only the entityimage field is not possible, nor do there appear to be any OOB hooks to see if that field has changed.

    The only other think I can think to research is Change Tracking. Otherwise it looks like you may have to upload the image on any Update of a Contact.

    Or, you could sync the image URL's from CRM to an external system and compare the one in CRM to the external system before uploading.