Need Help on "how to deactivate the Customer portal user using apex".
Currently we trying to deactivate the portal user with portal user sessionId. for this we are getting Exception as follows
@ EXCEPTION_THROWN||System.DmlException: Update failed. First exception on row 0 with id 00511000000QnNCAA0; first error: FIELD_INTEGRITY_EXCEPTION, Cannot de-activate self: Active: [IsActive]
i am using the code below for deactivate the portal user
User u = [select Id, IsActive, IsPortalEnabled from User where Id =: temp]; u.IsActive = false; IsPortalEnabled = false; update u;
with the same user session Id. how to do this???