You need to sign in to do that
Don't have an account?

On Change Date Stamp Trigger
I have two encrypted fields and when either of them change/get updated I want a date stamp to populate the date of change, essentially Today(), I can't do this via workflow as encrypted fields aren't available to use in Workflow.
I'm kind of stuck on where to start as I'm still learning.
I understand I need to use trigger.old and trigger.new to compare values of the fields but how do I do that across two fields? Or do I have to write two triggers? The only triggers I've done before update a value it is checking. how do I tell it to insert todays date into a field?
This is as far as I've got now I'm receiving the unexpected token compile error line 15 column 12
Im really stuck here - any help would be appreciated.
Thanks,
try this,
trigger insertupdatedate on Account(before update) {
for ( Account acc : trigger.new){
account oldacc = trigger.oldmap.get(acc.id);
if(acc.Route_Number__c != oldacc.Route_Number__c ){
acctNew.Last_Update__c = datetime.now();
}
if(acc.Account_Number__c != oldacc.Account_Number__c ){
acctNew.Last_Update__c = datetime.now();
}
}
}