I am trying to write a trigger which will help me to fire a workflow. Since according to my condition the workflow is not meeting the entry criteria. According to my knowledge the workflow entry criteria only meets when its condition fields got updated but in my case the condition fields are not getting updated. So finally i have last option as trigger which will fire when any field get updated in record.
Here I am trying to send the Password Reset Notification to the user one day before expiry date.
Can anyone please help me how to achieve this.
trigger workflowtrigger on User (before update,after update) {
for(User u : trigger.new){
if(u.LastPasswordChangeDate!=trigger.oldMap.get(u.Id).LastPasswordChangeDate){
System.debug('New-->'+u.LastPasswordChangeDate+'<-------'+trigger.oldMap.get(u.Id).LastPasswordChangeDate);
}
else{
System.debug('#######SAME##############');
}
}
}