+ Start a Discussion
Cheryl BeschCheryl Besch 

Asset History Tracking using PRIORVALUE Field

Since Assets don't allow for history tracking on fields, I am trying to create a long text field that tracks the values of these fields.  I have it pretty much worked out except for the picklist fields.  

Here is my Workflow Rule:
OR(
ISCHANGED( AccountId ),
ISCHANGED( ContactId),
ISCHANGED( SerialNumber ),
ISCHANGED( Serial_Number_2__c ),
ISCHANGED( Hardware_Status__c ),
ISCHANGED( Hardware_Model_iSC1__c),
ISCHANGED( Hardware_Model_iSC2__c )
)

Here is my Field Update:
"Asset changed from " +
PRIORVALUE(AccountId) +  "to " + AccountId + BR() +
PRIORVALUE( ContactId ) + "to " + ContactId + BR() +
PRIORVALUE( SerialNumber )+  "to " + SerialNumber + BR() +
PRIORVALUE( Serial_Number_2__c )+  "to " + Serial_Number_2__c + BR() +
PRIORVALUE( Hardware_Status__c ) + "to " + TEXT(Hardware_Status__c) + BR() +
PRIORVALUE( Hardware_Model_iSC1__c ) +  "to " +  TEXT(Hardware_Model_iSC1__c) + BR() +
PRIORVALUE( Hardware_Model_iSC2__c ) +  "to " +  TEXT(Hardware_Model_iSC2__c) + BR() + "by " + 
LastModifiedById +  BR() +
PRIORVALUE(Asset_History_Log__c)

The problem lies in the values the picklists are returning are not the actual PRIORVALUE, it is returning the picklist number(see bold below).
11to In Storage - New
1to ISC250-01P1227A
1to ISC250-01T2394A

Thoughts on how I can get the actual value to return?  Thanks,
Ramu_SFDCRamu_SFDC
Try to do this using before triggers. You can have total control on all the fields of the object. All you need to do is play around with trigger.oldmap collection and trigger.new collection. As an example you can refer to the below post

https://developer.salesforce.com/forums?id=906F00000008y1sIAA&language=en
AgiAgi
Hi,
for picklists put
TEXT(PRIORVALUE(Hardware_Status__c))