function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hm_inviHm_invi 

portal roles are not getting deleted from data loader, workbench?

Hi, 
Thanks in advance for your response.

I have these Portal roles that are not getting displayed in roles hierarchy tree but are there which i'm only able to view while i click on delete of that role. but i dont see edit, delete buttons in these portal roles. 
i was able to query those from the workbench, dataloader.io, data loader. 

SELECT Id, Name, ParentRoleId, PortalRole, PortalType FROM UserRole WHERE ParentRoleId='00Ew0000x01xNxIxxx'

When iam deleting these queried portal roles it displays deletion is success. 
But they are still there in the sandbox. 
No matter how many times i query and delete it still shows success but i cant delete. 

I dont know what iam missing here.
VinayVinay (Salesforce Developers) 
Can you check below which has details on considerations when Portal Roles are deleted?

https://help.salesforce.com/articleView?id=000329625&type=1&mode=1

Mass delete 'Portal' roles with Data Loader
https://help.salesforce.com/articleView?id=000313697&type=1&mode=1

You cannot delete Orphaned Customer Portal Roles.
https://trailblazer.salesforce.com/ideaView?id=08730000000gAhDAAU

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
AbhinavAbhinav (Salesforce Developers) 
Hi KM_cj

Roles can be deleted from any point in the hierarchy as long as a user is not assigned. If a user is assigned then, we need to move the users to a different role and then delete the role.
https://help.salesforce.com/articleView?id=000329625&type=1&mode=1


Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks!


 
Hm_inviHm_invi
i have followed the steps in the 
https://help.salesforce.com/articleView?id=000313697&type=1&mode=1.

status from data loader shows successfully deleted. but i dont see that portal role gone in the sandbox. there are also no users assigned to that portal role. 
no matter how many times i delete the same portal role from data loader, it shows delete success but it still exists.