2

I'm trying to have the column header populate a label based on a variable indication. Indication can carry "Crohn's (Fistulizing)" or "Ulcerative Colitis". I need the header to use custom label "JC_CM_DSA_SCORE_CROHNS" if indicaton = "Crohn's.." or use "JC_CM_DSA_Score_UC" if indication = "Ulcer.."

This is what I have so far:

<apex:column >
            <!-- Needs to be based on the patients indication -->
            <apex:facet name="header" ><b>{!$Label.JC_CM_DSA_SCORE_CROHNS}</b></apex:facet>
            {!IF(oAccount.Indication__r!=null,mapAccountDecrypted[oAccount.Gender__c],'')}
</apex:column>
6

You just need to use an if statement within the header label itself

 <apex:column >
    <!-- Needs to be based on the patients indication -->
    <apex:facet name="header" >
        <b>
            {!IF(<ObjectName>.Indication__c=='Crohn's..',$Label.JC_CM_DSA_SCORE_CROHNS, $Label.JC_CM_DSA_Score_UC)}
        </b>
    </apex:facet>
    {!IF(oAccount.Indication__r!=null,mapAccountDecrypted[oAccount.Gender__c],'')}
</apex:column>

Take note that this is assuming Indication__conly has two values "Chrons.." and "Ulcerative", if it has more than two values, you might need to use nested IF statements.

4
  • please mark as best answer if this solves your issue. Thanks – sfdx Feb 28 '16 at 21:28
  • I don't see the check mark that comes up under the arrows, not sure why... @Sean Soriano – kknaguib Feb 28 '16 at 22:31
  • You might be using a different account since the user who asked the question was user29247. – sfdx Feb 28 '16 at 23:06
  • 2
    For more than two values, use a CASE statement. – sfdcfox Feb 29 '16 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.