You need to sign in to do that
Don't have an account?
padma
System.QueryException: List has more than 1 row for assignment to SObject
Hi,
Below is my error when this error will be cmng my page
System.QueryException: List has more than 1 row for assignment to SObject
Thanks,
padma
Below is my error when this error will be cmng my page
System.QueryException: List has more than 1 row for assignment to SObject
Thanks,
padma
what you may be doing
------------------------------------------------
contact conlist = [select name from contact];
------------------------------------
and what you have to do
list<contact>conlist=[select name from contact];
Your SOQL query is returning more than 1 record and you are storing the result in single object.
u need list of sobject to store the result
You may be doing this:
public Account getaccount() {
return [select id, name from Account '];
}
what you should do:
public List<Account> getaccount() {
return [select id, name from Account ];
}
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Regards.