You need to sign in to do that
Don't have an account?
Ravi_SFDC
APEX Class
List has more than 1 row for assignment to SObject
System.QueryException: List has more than 1 row for assignment to SObject
Class.AccountSearchUI.<init>: line 13, column 1
My VF Page
<apex:page standardController="Account" extensions="AccountSearchUI"> <head> <title>Account Search UI</title> <style type="text/css"> </style> </head> <body> <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td height="5" bgcolor="#FFFFFF"> </td> <td height="5" bgcolor="#FFFFFF"> </td> <td height="5" bgcolor="#FFFFFF"> </td> </tr> <tr> <td bgcolor="#FFFFFF"></td> <td bgcolor="#FFFFFF"></td> <td bgcolor="#FFFFFF"></td> </tr> <tr> <td height="5" bgcolor="#FFFFFF"> </td> <td height="5" bgcolor="#FFFFFF"> </td> <td height="5" bgcolor="#FFFFFF"> </td> </tr> <tr> <td bgcolor="#FFFFFF" valign="top"> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" class="tablemain"> <tr><td height="1"></td></tr> <tr><td height="50" class="headingmain"> Account Search UI</td></tr> <tr> <td align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="1" class="tablemain"> <tr> <td width="10%" height="23" class="headingsub1">Group Org Acc</td> <td width="10%" height="23" class="headingsub1">Vertical</td> <td width="10%" height="23" class="headingsub1">Account Name</td> <td width="10%" height="23" class="headingsub1">Type</td> <td width="10%" height="23" class="headingsub1">Owner Last Name</td> <td width="10%" height="23" class="headingsub1">Client Rank</td> <td width="10%" height="23" class="headingsub1">Account Plan</td> <td width="10%" height="23" class="headingsub1">Last Modified</td> <td width="10%" height="23" class="headingsub1">View Latest PDF</td> <td width="10%" height="23" class="headingsub1">PDF Upload Date</td> </tr> <apex:repeat value="{!accPList}" var="cp"> <tr> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Group_Org__c}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Vertical__c}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Name}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Type}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Client_Rank__c}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Group_Org__c}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Vertical__c}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Name}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Type}"/></td> <td height="23" class="headingsub1"><apex:outputField value="{!cp.Client_Rank__c}"/></td> </tr> </apex:repeat> </table> </td> </tr> </table></td> <td bgcolor="#FFFFFF" valign="top"></td> <td bgcolor="#FFFFFF" valign="top"></td> </tr> <tr> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"> </td> </tr> </table> </body> </apex:page>
APEX Class
public with sharing class AccountSearchUI{ public ApexPages.StandardController stdController {get; set;} public Account acc {get; set;} public Account accPList {get; set;} public String accountName =''; public AccountSearchUI(ApexPages.StandardController stdController){ this.stdController = stdController; accPList = [select Group_Org__c, Vertical__c, Name, Type, Client_Rank__c from Account where Top_25_Client__c = true and Client_Rank__c < 26 order by Client_Rank__c ASC limit 5]; } }Can anyone help with the issue.
Please update your code lole below
Let us know if this will help you
All Answers
Please update your code lole below
Let us know if this will help you