locked
Notification email about changes based on audit log RRS feed

  • Question

  • Hi,

      My task is to send a notification email with a CRM workflow if a given entity changes. The email has to contain which fields of the entity changed + the old and new values of these fields. There is already an audit log implemented for this entity which stores the actual state of the entity after each update. The task is only to find out which fields were changed in the last update, so for this I need the last two records from the audit log of the current entity, but I don't know how can I do it in a send email action. Is it possible somehow? Or do I have to write a custom activity for this?

    Peter Neumann
    Monday, February 1, 2010 2:30 PM

Answers

  • Hi Peter,
    It's really depends how it looks structure or your audit system. If audit log is using other entity you will need to have a relationship between then. In this case you ca use workflow are refer to this record. I have audit with custom entity (called Audit) but in the one record I'm storing all information (entity name,  old value, new value, who create it and when) like here: http://crmaudit.codeplex.com/
    In my case it's not a problem to create a workflow equals with your requirements.

    Trigger: When field will be changed and mark all fields which are in form

    Actions: Send email and in body I need to put values from Related entity (to see it you will need 1-N relationship between them) and I'm able to put all information.

    If your case you have 2 records (one for old value and one for new - which is very weird) I don't have see posibility to do which by workflow unless it will be a custom workflow which requires development.


    My Dynamics CRM Blog: http://bovoweb.blogspot.com
    • Proposed as answer by kgorczewski Monday, February 1, 2010 3:17 PM
    • Marked as answer by Jim Glass Jr Tuesday, February 2, 2010 4:45 PM
    Monday, February 1, 2010 3:16 PM