Skip to main content

Hello Team,

 

I have added a checkbox on contact object to create a partner user. If it is checked then create a contact as a Partner user which works fine. However, I am unable to inactive user using APEX call using flow.

 

List<User> lstUser = [select Id from user where contactId IN: ContactIdList];         for(User uobject: lstUser){     if(uobject.Id != null){                  uobject.IsActive = false;                  //uobject.ContactId = '';              }         }         update lstUser;

I am able to set user account as Inactive but I want to remove contact association also with that users like disable partner user button works. How to do that? Is there any method to Inactive partner users in Salesforce? Thanks!

3 answers
  1. Oct 3, 2024, 12:18 PM

    The isPortalEnabled is a derived field. it can sometimes cause issues if there is other processing to be done after the portal user is disabled. Still checking what should be the right way of doing this. :(

0/9000