1 respuesta
Hi Simina,Greetings!This error occurs whenever you try to query the records to store it in the list which might return 0 records and if you try to use the List.I would suggest you to check the size of the List first and then you need to use the list as below; Player__c[] players = [SELECT Id from Player__c where Name = :username];
if (players.size() > 0)
p = players[0].Id;
I can see that you have 2 SOQL queries and you need to figure out which one is causing the issue by enabling the debug logs:
Reference:https://help.salesforce.com/apex/HTViewHelpDoc?id=code_add_users_debug_log.htm&language=en_usKindly mark it as best answer if it helps so that it can help others in the future.Warm Regards,Shirisha Pathuri