mercredi 20 juillet 2016

Conditional if statement on a visualforce page

We’re trying to get an output table by searching for a specific project that will then display information related to the master and child objects. This page will also need to do some behind the scenes calculations.

I have been working on a page but I am getting stuck with an input search on a specific project and doing calculations based on conditional if statements.

Any advice would be greatly appreciated.

VF:

   <apex:pageBlock title="Estimated Professional Services Fees">
        <apex:pageBlockTable value="{!estimate_list}" var="st">
            <apex:column headerValue="Cost Breakdown - EDRC - AE %">
                <apex:outputText value="{!IF(st.Professional_Service_Estimate__c.Type ='EDRC AE', st.Current_Fee__c + st.What_s_Added_b_c_of_salary_escalation__c + st.Added_b_c_of_Construction_Escalation_ECC__c)}"  />
            </apex:column>

        </apex:pageBlockTable>
    </apex:pageBlock>

    <apex:pageBlock title="Project Details">
        <apex:pageBlockTable value="{!estimate_list}" var="st">
            <apex:column headerValue="City">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.City__c}" />
            </apex:column>
            <apex:column headerValue="State">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.State__c}" />
            </apex:column>
            <apex:column headerValue="Building Type">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.Building_Type__c}" />
            </apex:column>

            <apex:column headerValue="CECC">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.CECC__c}" />
            </apex:column>
            <apex:column headerValue="ECC">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.ECC__c}" />
            </apex:column>
            <apex:column headerValue="Estimated Total GSF">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.Estimated_Total_GSF__c}" />
            </apex:column>

            <apex:column headerValue="Anticipated Date of Design Award">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.Anticipated_Date_of_Design_Award__c}" />
            </apex:column>
            <apex:column headerValue="Anticipated Start Date of Construction">
                <apex:outputField value="{!st.Professional_Service_Estimate__r.Anticipated_Start_Date_of_Construction__c}" />
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

Controller:

public class summary_table_ext {

public List<Professional_Service_Estimate_List__c> estimate_list {get; set;}

public summary_table_ext(ApexPages.StandardController controller) {


    estimate_list = [SELECT Id, Added_b_c_of_Construction_Escalation_ECC__c, What_s_Added_b_c_of_salary_escalation__c, Current_Fee__c,
                    EDRC_EMIC_Type__c, Escalated_by_Salary__c, Future_Fee_ECC__c, Percentage_ECC__c, Percentage__c, Professional_Service_Estimate__c,
                    Type__c, Professional_Service_Estimate__r.City__c, Professional_Service_Estimate__r.State__c, Professional_Service_Estimate__r.ECC__c, Professional_Service_Estimate__r.CECC__c, Professional_Service_Estimate__r.Estimated_Total_GSF__c, Professional_Service_Estimate__r.Anticipated_Date_of_Design_Award__c, Professional_Service_Estimate__r.Anticipated_Start_Date_of_Construction__c,Professional_Service_Estimate__r.Time_until_Midpoint_of_Design_years__c,
                    Professional_Service_Estimate__r.Building_Type__c, Professional_Service_Estimate__r.Name
                    FROM Professional_Service_Estimate_List__c];
}

}

Aucun commentaire:

Enregistrer un commentaire