function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rohit ApsangiRohit Apsangi 

Getting error in trailhead security superbadge challenge (step 2)

There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has more than 1 row for assignment to SObject
sunny522sunny522
Hi Rohit,
 If a query is returning 0 or more rows,then we need to use list to store results.
For example 
List<Account> lstAccount = [select id from Account]; 
If we use  like this 
Account a =[select id from account];
returns EXCEPTION: System.QueryException: List has more than 1 row for assignment to SObject error if we have more accounts in the system.
Please check in the challenge if its same issue.
Let me know if u need more help .specify more details if its not resolved
Bharat Gharat 5Bharat Gharat 5
unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has more than 1 row for assignment to SObject