I am working on a self deactivation process for a customer portal user. I have the 'User Self Deactivate' setting enabled which allows the customer user to set 'IsActive' to False from a Flow(within the community), but I am getting an error when I try to set 'IsPortalEnabled' to False.

Error message in Community:

An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information.

Error in Debug Logs:

12:21:56.0 (462991365)|FLOW_ELEMENT_ERROR|The flow tried to update these records: null. This error occurred: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: You do not have the necessary permissions to disable this portal user.. You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.|FlowRecordUpdate|Update_User

I have tried running the flow as current user and in system mode but no luck. When I run the Flow as a system admin, it works fine and sets both to False.

I looked at the FLS settings for the User object but 'IsPortalEnabled' is not an option (at least for my Community User profile).

Is there an easy way to set 'IsPortalEnabled' to False from a flow? Or will I have to create an Apex action to handle that portion?

  • Please edit your post to include the error message. – David Cheng Jul 29 '20 at 18:32
  • @DavidCheng added error messages to the post – Rory Jul 29 '20 at 18:47
  • May I ask the why are you setting the IsPortalEnabled flag to false. Shouldn't deactivating the user be enough and why allow user to do it. It should be an user administration operation. – manjit5190 Jul 29 '20 at 21:49
  • Just a follow up. I could not find a way for a Community user to get write access to this field. Instead of letting the user deactivate their own account, I created a flow in the community to mark a 'Request user deactivation' flag on the user object and create a case for a support agent to close their user account. This way the Community user still has an interactive way to start the deactivation process from right within the community but doesn't have access to fully deactivate their account. – Rory Aug 3 '20 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.