You need to sign in to do that
Don't have an account?
RAMANJINEYULU GOGULA
I want to fetch value from one method to another method
public with sharing class salescontroller
{
public string dat='this month';
public Integer leadcount{ get; set; }
public Integer getCountings()
{
Integer counts=[SELECT COUNT() FROM Lead];
leadcount=counts;
return counts;
}
public List<Lead> getCurrentMonthInfo()
{
List<Lead> ll=Database.query('SELECT Id,Name,Division_Name__c,Title,counting__c '+ 'FROM Lead');
return ll;
}
}
I need to transfer count value from getCountings() to getCurrentMonthInfo() and retrieve count variable value in this, Could anyone can solve this plz??
{
public string dat='this month';
public Integer leadcount{ get; set; }
public Integer getCountings()
{
Integer counts=[SELECT COUNT() FROM Lead];
leadcount=counts;
return counts;
}
public List<Lead> getCurrentMonthInfo()
{
List<Lead> ll=Database.query('SELECT Id,Name,Division_Name__c,Title,counting__c '+ 'FROM Lead');
return ll;
}
}
I need to transfer count value from getCountings() to getCurrentMonthInfo() and retrieve count variable value in this, Could anyone can solve this plz??
Trying to develop and I need to display leads per each user differently.
<apex:page sidebar="false" controller="salescontroller">
<h1 style="font-size:24px;"><center>SALES REPORT</center></h1>
<table Border='4' BORDERCOLOR='white' width="100%" cellspacing="4" cellpading="4" >
<tr align="center" BGCOLOR='#00FFFF'>
<td align="center" width="5%"><b>Name of the BD</b></td>
<td align="center" width="5%"><b>Division Name</b></td>
<!-- <td align="center" width="5%"><b>Sub Team</b></td>-->
<td align="center" width="5%"><b>Title</b></td>
<td align="center" width="5%"><b>Total Leads</b></td>
<td align="center" width="5%" ><b>Total Deals</b></td>
<td align="center" width="6%"><b>Payment Amount</b></td>
</tr>
<apex:repeat value="{!CurrentMonthInfo}" var="dat" >
<tr width="100%" BGCOLOR='#CCFFFF'>
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!dat.Name}" style="font-style:Arial;font-size:10pt;font-weight:bold;">
</apex:outputText>
</td>
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!dat.Division_Name__c}" style="font-style:Arial;font-size:10pt;font-weight:bold;">
</apex:outputText>
</td>
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!dat.title}" style="font-style:Arial;font-size:10pt;font-weight:bold;">
</apex:outputText>
</td>
<apex:repeat value="{!Countings}" var="cts">
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!cts}" style="font-style:Arial;font-size:10pt;font-weight:bold;">
</apex:outputText>
</td>
</apex:repeat>
<apex:repeat value="{!DealCount}" var="am">
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!am}" style="font-style:Arial;font-size:10pt;font-weight:bold;">
</apex:outputText>
</td>
</apex:repeat>
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!DealAmount}" style="font-style:Arial;font-size:10pt;">
</apex:outputText>
</td>
</tr>
</apex:repeat>
</table>
<!--
<apex:form >
<table>
<apex:repeat value="{!countings}" var="cts" >
<tr width="100%" BGCOLOR='#CCFFFF'>
<td align="center" width="2%" style="border-top:none;border-right:solid gray 1pt;border-left:none;border-bottom:solid gray 1pt;">
<apex:outputText value="{!cts}" style="font-style:Arial;font-size:10pt;font-weight:bold;">
</apex:outputText>
</td> </tr>
</apex:repeat></table>
</apex:form> -->
</apex:page>
Controller::
public with sharing class salescontroller
{
public String DealAmount { get; set; }
public string datee='this month';
public Integer leadcount{ get; set; }
public String opstage1='WON';
public String opstage2='Closed';
public Integer getCountings()
{
Integer counts=[SELECT COUNT() FROM Lead];
leadcount=counts;
return counts;
}
public List<Lead> getCurrentMonthInfo()
{
List<Lead> ll=Database.query('SELECT Id,Name,Division_Name__c,Title,counting__c '+ 'FROM Lead ORDER BY Name DESC');
return ll;
}
public List<Opportunity> getDealAmount()
{
Opportunity[] opp=Database.query('SELECT Amount FROM Opportunity');
return opp;
}
public Integer getDealCount()
{
Integer dealCount=[SELECT COUNT() FROM Opportunity]; // WHERE StageName=:opstage1 AND StageName=:opstage2
return dealCount;
}
}
I want to retrieve lead count, deal count and payment amount.
I think now everyone can get my point easily..
1. Heap Size
2. View State
3. SOQL Retrive Row
4. No of line script execution
5. Performance issue
We would recomment to use Standard Report to build many report and combine in to single dashboard (or) have some filter criteria in your VF page.
If you really want to go for VF page
use below wrapper class to build you logic:
Note : you can use list<wrapperClass> in your VF page.
Could u plz complete code for that by wrapper classses..