You need to sign in to do that
Don't have an account?
Patrick Conner
Keeping Track of Multiple Field Values
We currently import data to a field, overwriting old data each time. We'd like to begin importing data to that field and keeping the previous data as well. How can we do this?
My thoughts:
Instead of overwriting field values each import, is there a way to append to the current value? Ex. FIELD1: oldvalue1, newervalue1, importedtodayvalue1
Maybe it's necessary to import to a picklist and create a workflow rule to prepend new data to a field in a list similar to above? How would we go about doing this? We'd like all data to be searchable.
Thanks so much for any help!
My thoughts:
Instead of overwriting field values each import, is there a way to append to the current value? Ex. FIELD1: oldvalue1, newervalue1, importedtodayvalue1
Maybe it's necessary to import to a picklist and create a workflow rule to prepend new data to a field in a list similar to above? How would we go about doing this? We'd like all data to be searchable.
Thanks so much for any help!
@Sura - Thanks for answering! The problem is history tracking isn't searchable (required).
My solution:
- I created two fields - "Latest CardRef" (text, 40) and "CardRef History" (text area, long)
- I then created a workflow rule to evaluate when the record is created, and every time it’s edited, with the following criteria:
AND(ISCHANGED(Latest_Cardref__c),
NOT(ISBLANK(Latest_Cardref__c))
)
- On this work flow rule is an immediate action (field update) on CardRef History with the formula value:
Latest_Cardref__c & ', ' & (PRIORVALUE(Latest_Cardref__c))- This allows me to have the latest CardRef value in it's own field "Latest CardRef" for reporting, and all CardRefs, including all past CardRefs in a field (CardRef History) that is searchable.
Thanks!All Answers
How often you update field. if you want to keep track of last to field value only than you can create a field for old value like you said and keep it hidden in pagelayout or whatever you would like to do . you can create before update trigger or workflow to send the old value to another field(which wont be shown in pagelayout). that field should be searchble.
Create an object . 3 fields -
1)value
2)date
3)account- object map
you can create a trigger ,which will be trigger on update of value. create a record in object, which will be child record of card or account according to situation . that way you can link that with account . and can see all previous values, and will be dynamic.
hope that helps you :)
you can enable history tracking feature for the object . but Salesforce has enforece a limit of 20 fields per object on history tracking . through history tracking you can track all the changes made to fields of histroy tracking enabled object records
refer below link
http://salesforcecat.blogspot.com/2014/10/salesforce-history-tracking.html
@Sura - Thanks for answering! The problem is history tracking isn't searchable (required).
My solution:
- I created two fields - "Latest CardRef" (text, 40) and "CardRef History" (text area, long)
- I then created a workflow rule to evaluate when the record is created, and every time it’s edited, with the following criteria:
AND(ISCHANGED(Latest_Cardref__c),
NOT(ISBLANK(Latest_Cardref__c))
)
- On this work flow rule is an immediate action (field update) on CardRef History with the formula value:
Latest_Cardref__c & ', ' & (PRIORVALUE(Latest_Cardref__c))- This allows me to have the latest CardRef value in it's own field "Latest CardRef" for reporting, and all CardRefs, including all past CardRefs in a field (CardRef History) that is searchable.
Thanks!Salesforce history tracking records can be accessed form your apex code
please refer http://salesforcecat.blogspot.com/2014/11/salesforce-history-tracking-access.html
I think history tracking way is more reliable and take less development effort and saves you a custom object :).
CardRef_History__c & ', ' & (PRIORVALUE(Latest_Cardref__c))
Otherwise you overwrite the first value each time and only append the prior value, ending up with only 2 values in the field each time, instead of the entire history by appending the current field's prior value to the existing history.
FYI, I created a similar solution based on your example to replace a MSP containing muliple years with a Picklist and history field for my Permissions Slip fields. Since the picklist values are years, I wanted the most current year to be listed at the top, and to display the previous years in the history field, one on each line (I intend to add a validation rule to ensure the user cannot select a year earlier than the currently selected year):
TEXT(PRIORVALUE(Permission_Slip_year__c)) + BR() + Permission_Slip_History_years__c
p.s. Apparently there's a bug in Process Builder using BR() this way, so you have to use Workflow Rules (https://success.salesforce.com/issues_view?id=a1p300000008YkZAAU&title=_br_encoded_-markers-are-not-replaced-for-text-formula-values-used-by-apex-flow-process-when-those-values-are-populated-in-other-text-text-area-fields)