function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC_LearnerSFDC_Learner 

Adding values from merge fields directly in pageblock table or repeater

Hi

 
Im querying list of records from an object with fields Name,value1__c,value2__c.
 
I m not using any wrapper class to build this list.
 
and displayed all the data in pageblock table.
 
Here i need to add one more column to the existing pageblock table there i want to add the value1__c and value2__c and want to show in a new field.
 
 
When i am adding this with a merge field these two values are going to concate instead of addition like below
 
10 20 10+20
 
But i want
 
10 20 30
 
 
Any idea!
bob_buzzardbob_buzzard

What does your markup look like at the moment?

 

sambasamba

1. You need to create a list on the VF.

2. get all of fields from object, put them to this list.

3. create a pageblock, put a dynamic table to it.

4. when a user select a value from list. refresh pageblock.

 

Hope this helps.

 

Thanks,

Samba

puneet28puneet28

Hi 

<apex:page standardController="Account" recordSetVar="accounts" tabstyle="Account">
    <apex:form >
        <apex:pageBlock >
       <apex:pageBlockTable value="{!accounts}" var="acc">
            <apex:column > {!acc.id} </apex:column>
            <apex:column > {!acc.Account_Total_Amount__c} </apex:column>
            <apex:column > {!acc.No_Of_Contacts__c}</apex:column>
            <apex:column >{!acc.NumberofLocations__c}</apex:column>
            <apex:column >
            {!acc.No_Of_Contacts__c+ acc.NumberofLocations__c}
            </apex:column>
        </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 Basically it will be like {!apinameofield1 + apinameoffield2}