You need to sign in to do that
Don't have an account?
randombard
Failure Message: "System.QueryException: List has more than 1 row for assignment to SObject"
Hi All getting this error:
tom_test_error_conditions.test_package_error_conditions() | Class | 11 | 1 |
Failure Message: "System.QueryException: List has more than 1 row for assignment to SObject", Failure Stack Trace: "Class.tom_test_error_conditions.test_package_error_conditions: line 11, column 1"
Now there is only one queue that matches these criteria, but it does relate to multiple objects.
the line of code is.
Group payroll_queue = [select Id, Name from Group where (Name = 'Time_Off_Manager_Payroll') and (Type = 'Queue')];
Any help greatly apreciated.
R
Use limit keyword in the query as followed
All Answers
There might be two records for the scenario. Otherwise use "Limit 1"
Thanks
Bhuvana
Use limit keyword in the query as followed
Thanks Harsha for the trick
Regards
Deepak