You need to sign in to do that
Don't have an account?
Anass Haial 9
UserInfo.getUserId()) retunr null ?!
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.
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.
List<Profile> listProfile = [Select Name From Profile Where Id in (SELECT ProfileId
FROM User
WHERE id =:UserInfo.getUserId())];
system.debug(listProfile[0].Name);
And tell me what the log return.
It return the name of my profile : System Admin .