An internal server error is returned when bulk updating contacts to move them to a new portal account that does not have any portal roles
Last updated 2020-11-12 ·Reference W-1425912 ·Reported By 5 users
No Fix
Summary
An internal server error is returned when bulk updating contacts to move them to a new portal account that does not have any portal roles.
Repro
a) Make sure your admin user account has a role (e.g. CEO).
b) Enable Customer Portal.
c) Enable a contact as a customer user and select a profile linked to a user license that allows for roles (e.g. "Customer Portal Manager Custom"). Copy the contact ID.
d) Enable another contact as a customer user and select a profile linked to a user license that does not allow for roles (e.g. "High Volume Customer Portal"). Copy the contact ID.
e) In Developer Console, execute below code:
Id targetAccountId = '0013600000CZ6gl'; // replace with ID of account not linked to portal enabled contacts
List<Contact> contacts = new List<Contact>();
List<Id> contactIds = new List<Id>{'00336000007pDZ0','00336000007pDYy'}; // replace IDs with contact IDs obtained in steps c) and d)
for(Id cId : contactIds) {
contacts.add(new Contact(id=cId, accountId=targetAccountId));
}
update contacts;
f) Debug logs will show an "Internal Salesforce.com Error" after the DML operation:
04:15:01.5 (314345570)|DML_END|[7]
04:15:01.5 (315055362)|FATAL_ERROR|Internal Salesforce.com Error
Workaround
Update the contacts linked to role-less portal users first, and then the remaining contacts.
To find which contacts are linked to role-less portal users you may run this SOQL query:
select contactid from user where contactID IN (<contactIds>) and userroleId = ''
Reported By (5)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.