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?