You need to sign in to do that
Don't have an account?
dho1
Issue with beforeupdate Trigger on User object
I've got a beforeUpdate trigger on user that is supposed to do some work when the user is deactivated. However the code seemed to not pass the below condition:
if (i.isactive == false)
{
//do some work here
}
Shouldn't I be detecting for the Isactive field for this?
TIA!
Your logic is correct and it should work. If you could post your code,i may be able to help you further.
i tried something like this and it worked.
trigger beforeUpdateonUser on User (before update) {
List<User> ulist=new List<User>();
for(User u:Trigger.new){
User uold=Trigger.oldMap.get(u.id);
if((u.IsActive==false) && (uold.IsActive ==true)) {
u.FirstName ='Inactive User';
ulist.add(u);
}
}
}