Skip to main content
added 379 characters in body
Source Link
Mohith Shrivastava
  • 91.9k
  • 19
  • 161
  • 214

This can happen if you are trying to share records with an inactive user or when you are assigning inactive user as the record owner .Make sure that you filter your query to include only active users with isActive=true .Certainly this is an error in apex and not an SFDC bug

For custom exception implement an exception class like below

public class InactiveUserException extends Exception {}

And then in your catch block use the below

try{
    update updateAccMap.values();
}catch(Exception e){
  throw new InactiveUserException(
           'Activated the user you are trying to assign the Account');
}

This can happen if you are trying to share records with an inactive user or when you are assigning inactive user as the record owner .Make sure that you filter your query to include only active users with isActive=true .Certainly this is an error in apex and not an SFDC bug

This can happen if you are trying to share records with an inactive user or when you are assigning inactive user as the record owner .Make sure that you filter your query to include only active users with isActive=true .Certainly this is an error in apex and not an SFDC bug

For custom exception implement an exception class like below

public class InactiveUserException extends Exception {}

And then in your catch block use the below

try{
    update updateAccMap.values();
}catch(Exception e){
  throw new InactiveUserException(
           'Activated the user you are trying to assign the Account');
}
Source Link
Mohith Shrivastava
  • 91.9k
  • 19
  • 161
  • 214

This can happen if you are trying to share records with an inactive user or when you are assigning inactive user as the record owner .Make sure that you filter your query to include only active users with isActive=true .Certainly this is an error in apex and not an SFDC bug