You need to sign in to do that
Don't have an account?
Sascha Deinert
Unknown property 'Integer.Amount'
Hi,
If I try to save the apex code, I get the error Unknown property 'Integer.Amount'
Could you help me to fix the problem.
Thanks,
Sascha
If I try to save the apex code, I get the error Unknown property 'Integer.Amount'
Could you help me to fix the problem.
Thanks,
Sascha
<apex:page controller="VTPTeam7_class"> <apex:form > <apex:pageblock > <apex:pageBlockButtons location="top" > <apex:commandButton action="{!myAnalyze2}" value="Search" id="SearchButton" style="align:center"/> </apex:pageBlockButtons> <table border="1"> <tr> <td>Target Name</td> <apex:repeat value="{!RTypeList}" var="RL"> <td> <apex:outputfield value="{!RL.Name}"/> </td> </apex:repeat> </tr> <apex:repeat value="{!ValueList}" var="VL1"> <tr> <td> <apex:outputField value="{!VL1.Owner.Name}"/> </td> <apex:repeat value="{!Summaries}" var="VL2"> <td> {!VL2.Amount} </td> </apex:repeat> </tr> </apex:repeat> </table> </apex:pageblock> </apex:form> </apex:page>
Public Class VTPTeam7_class { Public List <RecordType> RTypeList {get; set;} Public List <User> UserList {get; set;} Public List <Opportunity> ValueList {get; set;} Public List <Integer> Summaries {get; set;} Public VTPTeam7_class() { } Public void myAnalyze2() { RTypeList = [SELECT Id, Name FROM RecordType WHERE SobjectType = 'Opportunity']; UserList = [SELECT Id, Name FROM User WHERE Team__c = 'Team Bayern']; List <Integer> Summaries = new List <Integer>(); FOR (User UserName : [SELECT Id, Name FROM User WHERE Team__c = 'Team Bayern']) { FOR (RecordType RType : [SELECT Id, Name FROM RecordType WHERE SobjectType = 'Opportunity']) { ValueList = [SELECT Owner.Id, Owner.Name, RecordType.Id, Amount FROM Opportunity WHERE Owner.Id = :UserList AND RecordType.Id = :RTypeList]; IF (ValueList.size()==0) { Summaries.Add(0); } ELSE { Summaries.Add(1); } } } } }
Thanks, I changed the code and now I get a list.
But my result is not very nice, it looks like
Target Name | RecordType 1 | RecordType 2 | RecordType 3
User 1 | 100000 | 40000 | 300000 | 2500000 | 100000
User 1 | 100000 | 40000 | 300000 | 2500000 | 100000
User 2 | 100000 | 40000 | 300000 | 2500000 | 100000
User 3 | 100000 | 40000 | 300000 | 2500000 | 100000
User 3 | 100000 | 40000 | 300000 | 2500000 | 100000
I get for each user (row) all opportunities of all user.
How can I change the code to show like this
Target Name | RecordType 1 | RecordType 2 | RecordType 3
User 1 | 0 | 0 | 300000
User 1 | 0 | 40000 | 0
User 2 | 100000 | 0 | 0
User 3 | 2500000 | 0 | 0
User 3 | 0 | 0 | 100000
Thanks,
Sascha
could you take a look again to my code.
Thanks,
Sascha
Page Controller
Component Controller
Component
Page
NOTE: This code may contain typographical or logical errors
thanks for your respone.
I get an error if I run your code
Method does not exist or incorrect signature: [Map<Id,User>].keys() at line 39 column 31
Could you please take a look.
Thanks,
Sascha
I tried your code, but I get an error:
Illegal assignment from User to String at line 10 column 13
I want to change the string into id, but the I get the same error with id.
No problem, vacaction is ok, I'm glad that you hlep me again and again and again :-)
I get one more error. If I try to save the component I get the following error
Type mismatch for <apex:attribute assignTo>. Value binding to a property of type Map<Object,Object> is required, property specified (amtMap) is of type Map<Id,Integer>.
Sorry I wasn't able to actually test this. Most of this is coming off the top of my head and I'm just praying it works :)
[Error] Error: getOppAmount line 4, column 22: Element type "Object" must be followed by either attribute specifications, ">" or "/>"
[Error] Error: Element type "Object" must be followed by either attribute specifications, ">" or "/>".
VTPTeam8_class.cls getOppAmount_Controller.cls getOppAmt.component TeamClass.page
I had to do some "interesting" work around sending the amount map to the component, but it does work.
It is possible to change the code very easy to aggregate the values of each user and opportunity.recordtype?