Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Force.com Sites & Site.com
- :
- how to disable a customer portal contact/user with...
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
how to disable a customer portal contact/us er within APEX?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-24-2010 09:03 AM
Is it possible to disable customer portal users via APEX?
I have a trigger which deactivates users via a trigger on a contact checkbox field called "Provision extranet", but the contact record cannot be deleted until the portal user is disabled. I would like to deactivate and disable the user in one operation.
0
Re: how to disable a customer portal contact/us er within APEX?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-29-2010 12:57 PM
Hi,
Could you pass me trigger , so that i have better understanding.
Mayank Joshi
BirlaSoft Ltd| Noida | INDIA
There are two ways of writing a code, the hard way and the best way, Of-course the hard way is the easy way&best way is always hard way.
BirlaSoft Ltd| Noida | INDIA
There are two ways of writing a code, the hard way and the best way, Of-course the hard way is the easy way&best way is always hard way.
0
Re: how to disable a customer portal contact/us er within APEX?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-30-2010 03:52 AM
Thanks for the reply, but I figured it out.
I just needed to set the IsPortalEnabled to false. Previously, I was just setting IsActive to false.
for(User u : [Select u.Id, u.IsActive, u.IsPortalEnabled from User u where u.ContactId in :cIds]){
if(u.IsActive || u.IsPortalEnabled ){
u.IsActive = false;
u.IsPortalEnabled = false;
usersToUpdate.add(u);
}
}
I just needed to set the IsPortalEnabled to false. Previously, I was just setting IsActive to false.
for(User u : [Select u.Id, u.IsActive, u.IsPortalEnabled from User u where u.ContactId in :cIds]){
if(u.IsActive || u.IsPortalEnabled ){
u.IsActive = false;
u.IsPortalEnabled = false;
usersToUpdate.add(u);
}
}

