web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to capture and store a field each time it changes

(0) ShareShare
ReportReport
Posted on by 26

If an Account name changes, I need to send an email to some people.  In the email I need to let them know what the original name was and then what the new name is.  How can I capture this? 

I have the same question (0)
  • Suggested answer
    Ramit Paul Profile Picture
    22,797 Most Valuable Professional on at

    If your question was related to MSD365 FO, then you can use changed base alert feature.

    docs.microsoft.com/.../alerts-overview

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    Ideally, you should:

    • Enable Auditing.
    • Create a workflow to send an email with the Account link (Dynamics Record URL), whenever the account name changes.
    • User clicks on the Record, the account will open, and then they can see Audit History for the new and old value

    If it is necessary to send old and new name in the Email, you can use either a real-time workflow (with a temp field or use a plugin with pre and post-image).

    As a No-Code solution, use a real-time workflow with a temp field, see the following article:

    Real-Time Workflow: Capturing Pre and Post Values | PowerObjects

    For plugins, you need to write a plugin that:

    • Triggers on Account Update (Pre-stage).
    • Register Pre and Post Images with the account name field.
    • Now you will get the pre and post values of the account name in the plugin, send an email using SendEmailRequest.

    Here is a sample:

    Dynamics 365 Plugins - Pre and Post Images - Carl de Souza

    To send an email using C#/plugin:

    Send a Dynamics 365 Email using C# - Carl de Souza

  • AriaConsulting Profile Picture
    2 on at

    USA80,

    There are even additional options to the ones that Wahaj Rashid kindly provided. However, this method gives you the option to report on/action changes from any 365 service that is enabled for auditing (including SharePoint and Exchange even).  In any case you have to have auditing turned on and configured.  Once auditing is on you can use the Office 365 Management Activity API to query the M365 (not D365) Compliance Center, which is where the log data actually ends up.  It goues there as otherwise you would chew through your D365 storage quota very quickly indeed!  Once you connect to the API and format the query(ies) you want, you can use a webhook for notifications.  Which can obviously be in the format of email.  The bonus with this is that if you have PBI licenses you can get double the benefit from the same work by also hooking it up to PowerBI.  And if you want to get even more fancy you could create a running history in a custom table and then add said custom table to the D365 form as a subgrid.

    If you want to take on an entire project of effort you could go all the way to connecting the audit logs to Azure Sentinel (Microsoft's SIEM tool) and then you can get such a deluge of information d insight it would likely make your head hurt.  But that's probably 3 or 4 orders of magnitude more than you're wanting .

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi,

    There is also an approach that requires no code:  

    Create a technical field (OldName)

    A Workflow that runs before the modification of the Name field, which will store the current value of the name in the technical field (OldName)

    A second Workflow that will run after the modification and that will retrieve the old value from the created technical field. So you can send your mail with both values.  

  • AriaConsulting Profile Picture
    2 on at

    Uhhh meelamri, that's exactly what Wahaj Rashid suggested......

  • meelamri Profile Picture
    13,216 User Group Leader on at

    Right, good point :)

  • AriaConsulting Profile Picture
    2 on at

    LOL!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 49 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans