+ Start a Discussion
Kumaresan M 2Kumaresan M 2 

Unable to display combined Variables in MAP inside reapeat in Visual force page ?

Hi All,

I need to display a value from MAP<String,Decimal> in VF page. But i am refering two variables as a key in repeat like (Name +'-'+Product name). I am getting error in experrion..,

Here is my VF code:
<apex:pageBlockTable value="{!commProductAgentFinal}" var="r">
                        <apex:column value="{!r.name}">
                            <apex:facet name="header">Carrier Name</apex:facet>
                        </apex:column>  
                        <apex:column value="{!r.Product__r.name}">
                            <apex:facet name="header">Product Name</apex:facet>
                        </apex:column>
                        <apex:column value="{!r.Option__c}">
                            <apex:facet name="header">Option</apex:facet>
                        </apex:column>
                        <apex:column value="{!r.Beginning_Age__c}">
                            <apex:facet name="header">Beg age</apex:facet>
                        </apex:column>
                        <apex:column value="{!r.Ending_Age__c}">
                            <apex:facet name="header">End age</apex:facet>
                        </apex:column>
                        <apex:column value="{!r.Beg_Face_Amount__c}">
                            <apex:facet name="header">Beg Face</apex:facet>
                        </apex:column>
                        <apex:column value="{!r.End_Face_Amount__c}">
                            <apex:facet name="header">End Face</apex:facet>
                        </apex:column>
                        <apex:column value="{!FinalMap[{!r.name}+{!r.Product__r.name}]}">
                            <apex:facet name="header">Total points</apex:facet>
                        </apex:column>          
                    </apex:pageBlockTable>

Controller:
public Map<string,Decimal> FinalMap {get; set;}

Error:Map key r.name-r.Product__r.name not found in map

Error is in expression '{!FinalMap['r.name-r.Product__r.name']}' in component <apex:column> in page commission_schedule

Can anyone help on this ?
Kumaresan M 2Kumaresan M 2
I tried with this below code also. Not works:

<apex:column value="{!FinalMap['r.name-r.Product__r.name']}">
<apex:facet name="header">Total points</apex:facet>
</apex:column>
Ankush DurejaAnkush Dureja
Try to use following code:

<apex:column value="{!FinalMap[r.name-r.Product__r.name]}">
<apex:facet name="header">Total points</apex:facet>
</apex:column>

Kumaresan M 2Kumaresan M 2
I tried with this: 

Error: Error: Incorrect parameter type for operator '-'. Expected Number, Date, DateTime, received Text

It not works.
Kumaresan M 2Kumaresan M 2
I got this resolved this issue by keeping formula field in object level and using that field as a key in VF page. 

Thanks for your help.