• Anass Haial 9
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
We have a milestone that execute a field update, this field update trigger the Case Ater update trigger.
The trigger after update on case use the following function  :  THA_Utils.getProfileIdByName(UserInfo.getUserId());
[...]
public static string getProfileIdByName(Id isUser) {  
List<Profile> listProfile = [Select Name From Profile Where Id in (SELECT ProfileId
                                     FROM User
                                     WHERE id =:idUser)];
                                 return listProfile[0].Name;
 }
We are getting error on the   :  return listProfile[0].Name;   / caused by: System.ListException: List index out of bounds: 0: Class.THA_Utils.getProfileNameByIdUser: line 65, column 1".

Does anyone know why we have this bug ? 
the Default Workflow User is already set up as active admin... I don't udenrstand why we get this error.
We have a milestone that execute a field update, this field update trigger the Case Ater update trigger.
The trigger after update on case use the following function  :  THA_Utils.getProfileIdByName(UserInfo.getUserId());
[...]
public static string getProfileIdByName(Id isUser) {  
List<Profile> listProfile = [Select Name From Profile Where Id in (SELECT ProfileId
                                     FROM User
                                     WHERE id =:idUser)];
                                 return listProfile[0].Name;
 }
We are getting error on the   :  return listProfile[0].Name;   / caused by: System.ListException: List index out of bounds: 0: Class.THA_Utils.getProfileNameByIdUser: line 65, column 1".

Does anyone know why we have this bug ? 
the Default Workflow User is already set up as active admin... I don't udenrstand why we get this error.