You need to sign in to do that
Don't have an account?
lescclarkcpd
Mass disable customer users
Hi
I have a whole bunch of contacts that have "Customer Portal User" accounts associated with them.
I want to 'Mass disable' some of these contacts from the customer portal accounts. You can do this manually on each contact by hitting 'manage external users' and then 'disable customer user' but want to see if I can create a trigger to do this en mass, any ideas as to the method to do this, can't sem to find reference to this anywhere
thanks
les
I have a whole bunch of contacts that have "Customer Portal User" accounts associated with them.
I want to 'Mass disable' some of these contacts from the customer portal accounts. You can do this manually on each contact by hitting 'manage external users' and then 'disable customer user' but want to see if I can create a trigger to do this en mass, any ideas as to the method to do this, can't sem to find reference to this anywhere
thanks
les
You can execute following code for disabling portal users in mass:
list<user> lst = new list<user>();
for(user u :[SELECT id, name , IsPortalEnabled FROM User where isportalenabled = true]){
u.isactive = false;
lst.add(u);
}
Update lst;
You can execute this code in anonymous apex script in the developer console or in Force.com Ide
this sets the user account to inactive, it doesn't 'disable customer user'
the contact and the user are still linked, it's this link that I want to delete
thanks