The Detail Department

  • Our Services
    • Strategy
    • Analysis
    • Implementation
    • Training
  • Applications
    • Salesforce
    • Confluence
    • WordPress
    • Other Apps
  • About Us
    • Jodie Miners
    • Projects
    • Privacy Policy
  • Blog

© The Detail Department Pty Ltd 2016

You are here: Home / Salesforce / Making an Audit Tracking Field in Salesforce

Making an Audit Tracking Field in Salesforce

11-Oct-2011 by Jodie Miners

This is a quick post to share a tip that I found to create a field to track changes to another field. Sure you can do it with a trigger and some code, but this is a no-code work-around.

I found this idea on Salesforce Idea Exchange here and modified it as I needed to. The reason to use this idea is that the History Tracking feature only tells you that the field has changed, rather than the field value has changed from x to y.

If there are just a few key fields that you need to do full audit tracking on, then this may be an option. I have set this up on Cases for the custom Case Response field – the field that contains the information as to what was done to resolve this Case.

Steps:

  • In Cases, Add a new long text formula field called Case Response History.
  • Create a new Workflow Rule called Append Case Response History or similar to do a Field Update on the Case Response History field
  • The formula for the Worflow is something along the lines of this:

"Last Modified: " + LastModifiedBy.FirstName & ' ' & LastModifiedBy.LastName  + TEXT(LastModifiedDate + 0.4167) + BR() + "------" + BR() +
PRIORVALUE( CaseResponse__c ) + BR() +
CaseResponseHistory__c

    • You can play around with this formula, but I found this layout was good. The main components are that we are updating the Case Response History field with the previous value of the Case Response field, along with all the previous history that is already in the Case Response History field, then tagging it with the name and date of the update. I also have a line to divide each entry.
    • The 0.4167 in the date formula converts UTC time to Sydney timezone. The default date format is a bit ugly, so you may want to do a lot more tweaking of this date field to change the format.
    • The current value is in the Case Response field – this field only shows us what the previous value(s) were. The way I have set this up is that it shows the date that the current value was updated with the date/time and who updated it, in the history field. That way the next time the field is updated, that value will be listed with the date/time record of when it was updated. You need to test this out with a few updates to the field to see what I mean here (it makes sense to me, at least). If you don’t like this, then just modify the formula.
  • Add the Case Response History field to the Cases Page Layout so you can see the audit history on the Case Record.

Notes:

  • Beware: This is not entirely foolproof. The System Administrator or anyone with Modify All Data can edit the Audit field.
  • This would probably be better as a hidden field that doesn’t take up space on the Cases form.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • More
  • Click to print (Opens in new window)

Filed Under: Salesforce

Jodie Miners

Jodie Miners is the Director of The Detail Department. She can help your business move from vision to reality with the right systems for your business.
Her eye for detail and her understanding of the ‘bigger picture’ will create and integrate seamless business systems. Read More about Jodie…

View My Blog Posts

Comments

  1. Dawn Plaskon says

    15-Sep-2012 at 4:26 AM

    So, we needed a similar functionality and found the following changes needed:

    1) You must create a long text field that contains the results of a workflow field update
    2) The workflow field update contains the formula in the post above
    3) The workflow criteria is Priorvalue(sourcefield) sourcefield
    4) Workflow is set on every create or edit

    With these modifications to the solution presented above, the audit field update worked like a charm without adding unnecessary content.

  2. jbh says

    5-Apr-2012 at 6:13 AM

    This is a cool idea and the Field Update logic you posted makes sense, but how did you setup the Workflow Rule itself? I found that my rule was triggering more than I wanted and I was getting LOTS of redundant data stored in the history field. There’s no obvious way to me to see if the field you’re tracking has actually changed or if it was some other field on the same object that got updated.

  3. mfrancis26 says

    20-Jan-2012 at 10:48 AM

    Thanks so much for this posting!!! Great creativity. This was so dang timely.Looking forward to more posts.

Trackbacks

  1. Thinking Like Salesforce « JodieM.com.au says:
    4-Jan-2012 at 4:56 PM

    […] or to). So create a Audit field and populate it each time the long text field is changed. I have documented a solution on this […]

Search this Website

Subscribe to Blog Posts

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Latest Posts

Advice for Salesforce Career Progression

So, you want to learn Salesforce?

Your Business Needs More Than Just a Website

Q and A: Apps for Service Delivery

Using Wufoo Forms with Salesforce

Integrations are The New Black

We need to talk about Documentation

Tools to help write help documents

Moving away from Command and Control

My ultimate guide to getting started with Gmail