You need to sign in to do that
Don't have an account?
SFDC n12
Apex code help needed
Hi,
I am having a followng apex code which is reutrning the following error
"List has more than 1 rows assignment to S object"
VF PAGE :
<apex:page standardController="AccountExceptions__c" extensions="AF_ExecutiveReportController">
<apex:form >
<style>
.headerRow .TableTitle {
color: #CC0000 !important;
}
</style>
<apex:pageBlock title="Executive Committee Report" >
<b> <apex:outputText value="1.Total Exceptions ($50,000 threshold per Region):" style="Color:purple" /></b>
<apex:pageBlockTable value="{!accexp}" var="item" rendered="{!accexp.Type__c=='Exception Adjustment' || accexp.Type__c=='Business Relationship Adjustment'}">
<b> <apex:column headerValue="Region" headerClass="TableTitle"/> </b>
<b> <apex:column headerValue="TotalExceptions" Value="{!accexp.Total_Amount_of_Current_Exception__c }" headerClass="TableTitle"/> </b>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
MY CONTROLLER :
public class AF_ExecutiveReportController {
public AccountExceptions__c accexp{get; set; }
/**
** Constructor
**/
public AF_ExecutiveReportController (ApexPages.StandardController controller) {
accexp= [Select Id,Account__c,ADR_Month__c,DOSUser__c,Total_Amount_of_Current_Exception__c FROM AccountExceptions__c WHERE ADR_Month__c!=null ];
}
}
i want to display alll the values for the field i called in my vf page
Help me what do i need to change in my code
Thanks in Advance
I am having a followng apex code which is reutrning the following error
"List has more than 1 rows assignment to S object"
VF PAGE :
<apex:page standardController="AccountExceptions__c" extensions="AF_ExecutiveReportController">
<apex:form >
<style>
.headerRow .TableTitle {
color: #CC0000 !important;
}
</style>
<apex:pageBlock title="Executive Committee Report" >
<b> <apex:outputText value="1.Total Exceptions ($50,000 threshold per Region):" style="Color:purple" /></b>
<apex:pageBlockTable value="{!accexp}" var="item" rendered="{!accexp.Type__c=='Exception Adjustment' || accexp.Type__c=='Business Relationship Adjustment'}">
<b> <apex:column headerValue="Region" headerClass="TableTitle"/> </b>
<b> <apex:column headerValue="TotalExceptions" Value="{!accexp.Total_Amount_of_Current_Exception__c }" headerClass="TableTitle"/> </b>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
MY CONTROLLER :
public class AF_ExecutiveReportController {
public AccountExceptions__c accexp{get; set; }
/**
** Constructor
**/
public AF_ExecutiveReportController (ApexPages.StandardController controller) {
accexp= [Select Id,Account__c,ADR_Month__c,DOSUser__c,Total_Amount_of_Current_Exception__c FROM AccountExceptions__c WHERE ADR_Month__c!=null ];
}
}
i want to display alll the values for the field i called in my vf page
Help me what do i need to change in my code
Thanks in Advance
public List<AccountExceptions__c> accexp{get; set; }
/**
** Constructor
**/
public AF_ExecutiveReportController (ApexPages.StandardController controller) {
accexp=new list<AccountExceptions__c>();
accexp= [Select Id,Account__c,ADR_Month__c,DOSUser__c,Total_Amount_of_Current_Exception__c FROM AccountExceptions__c WHERE ADR_Month__c!=null ];
}
}
Mark as best answer if it solves your problem :)
All Answers
http://salesforce.stackexchange.com/questions/37157/error-on-a-different-test-class-list-has-more-than-1-row-for-assignment-to-sobj
List<AccountExceptions__c>accexp= [Select Id,Account__c,ADR_Month__c,DOSUser__c,Total_Amount_of_Current_Exception__c FROM AccountExceptions__c WHERE ADR_Month__c!=null ];
and in my vf use
<b> <apex:column headerValue="TotalExceptions" Value="{!accexp.Total_Amount_of_Current_Exception__c }" headerClass="TableTitle"/> </b>
let me know if its right ?
Thanks
public List<AccountExceptions__c> accexp{get; set; }
/**
** Constructor
**/
public AF_ExecutiveReportController (ApexPages.StandardController controller) {
accexp=new list<AccountExceptions__c>();
accexp= [Select Id,Account__c,ADR_Month__c,DOSUser__c,Total_Amount_of_Current_Exception__c FROM AccountExceptions__c WHERE ADR_Month__c!=null ];
}
}
Mark as best answer if it solves your problem :)