0

I want to attach the existing contact with new user and for that, I'm disabling the inactive record to isolate the contact then creating a new user and attaching it with the existing contact, but when I try to update IsPortalEnabled=FALSE, It gave me below error,

           User isPortalUser = [SELECT ID, Name, IsPortalEnabled, isActive from user where ID ='0056E0000032xRAQAY' LIMIT 1];

           isPortalUser.IsPortalEnabled = FALSE;

            update isPortalUser;

The Error Message

System.DmlException: Update failed. First exception on row 0 with id 0056E0000032xRAQAY; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You do not have the necessary permissions to disable this portal user.: []

common.apex.runtime.impl.DmlExecutionException: Update failed. First exception on row 0 with id 0056E0000032xRAQAY; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You do not have the necessary permissions to disable this portal user.: []"|0x2761845

How to grant access to it to update the records??

  • Did you deactivate the portal user through Apex or via Setup > Manage Users? If deactivating through Apex, you should set IsActive = false and IsPortalEnabled = false at the same time. salesforce.stackexchange.com/questions/17389/… – David Cheng Jul 17 '18 at 0:09
  • I try that and set the both to FALSE, it still gives me the error. – sami ullah Jul 17 '18 at 7:11

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.