Professional Documents
Culture Documents
Interview
Interview
Interview
=====================================================
trigger Accounttri9gger on Account (After insert,After update) {
AccountTriggerHandler.makeInactive(trigger.new,trigger.oldMap)
}
===========================================================
public class AccountTriggerHandler{
}
List <Contact > conlist = [select id,Accountid from contact where Accountid IN :
accids];
for (Contact con :conlist){
if (accids .contains(con.Accountid)){
con.IsActive = false ;
updateContacts .add(con);
if (!updateContacts .isEmpty()){
update updateContacts ;
@ future
private static void updateUser (List <id> ownerid){
List <user> updateUserList = new list <user> ();
List <user> userList = [select id from user where id IN :ownerid];
for (user u : userList ){
u.isActive = false;
updateUserList .add(u);
}
if (!updateUserList .isEmpty(){
update updateUserList ;