this is the structure of my code:
In the constructor i build a fake account which i use into a visualforce page to get an inputfield which can lookup into accounts through the OwnerId.
userInput = new Account();
Then i have a method which tries to fetch account teams using the OwnerId previously set.
String rolestring = 'Core User'; AccountTeamMember clients = [Select UserId, AccountId, TeamMemberRole From AccountTeamMember Where UserId = :userInput.OwnerId AND TeamMemberRole = :rolestring];
This simply isn't working. I tried the very same query through the developer console (and it works fine) but even by putting a fixed 15-digits ID for the userId, it's not working. Then i tried with the same ID but with its 18-digit version and it WORKS. So the question is: how can i get the 18-digit version of the id i previously put in the OwnerId field of my 'fake' account? I also tried to fetch the user and assign its ID to an ID variable but it's still not working ! (i found this post saying it would do the trick but it doesn't !) I am basically looking for something like the CASESAFEID function but for Apex!