PowerObjects Blog 

for Microsoft Business Applications

Real-Time Workflow: Capturing Pre and Post Values

Post Author: Joe D365 |

In Dynamics 365, field values can change all the time. Generally speaking, we only care what a field's current value is, but there are certainly cases where we need to be able to track and audit previous values of a field. In today's blog, we'll describe a nifty trick for capturing not only what a field value changes to, but what it changes from, as well.

For purposes of our discussion, let's assume we want to track the previous value of a field called "Account Name." To accomplish this, you may intuitively think about adding a new field – something like, "Account Name Old," perhaps. You'd be on the right track, but we actually need to go a step further and add a third field – something like, "Account Name Temp." If we combine that with a workflow, we will have a working solution. Here's how it works:

First, we create two new fields, Account Name Temp and Account Name Old (both single line of text). Whenever the value of Account Name changes within our workflow, we can start to copy information across.

  • Step 1 – copy Account Name Temp to Account Name Old
  • Step 2 – copy Account Name to Account Name Temp

It looks something like this:

Capturing Pre and Post Values

Behind the scenes, it looks like this:

Capturing Pre and Post Values

To test this process, I populated my 2 new fields into the account screen and played with the data. I created an account called "Happy Street School" and then changed it to "Sad Street School." I saved after changing the name. As you can see below, the workflow achieved its goal: the Account Name Old field will ALWAYS contain the previous name.

Capturing Pre and Post ValuesCapturing Pre and Post Values

Hopefully, this gives you a few ideas on how you can audit and track key fields by keeping the previous data visible on a field. If you would like more information on real-time workflows, check these recent blogs:

Don't Delete Your Configuration Data! Use Real-Time Workflows Instead

Retrieving Data from a Related Entity with Real-Time Workflows in CRM 2013

Happy CRM'ing!

By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

One comment on “Real-Time Workflow: Capturing Pre and Post Values”

PowerObjects Recommends