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
Becky Miller 15Becky Miller 15 

Rendering a different header in VF based on the user?

I want the column heading to say "Invoiced" for one group of people and "Actual Sales" for another group of people.  

            
                    <apex:column headerValue="Actual Sales" rendered={!if(!q.IsProcedural__c,true,false)}">
                        <apex:outputText value="{!q.Annual_Actual_Sales__c}" style="width:70px" />
                    </apex:column>

Now this is not rendering anything for anyone.  What am I doing wrong?
Best Answer chosen by Becky Miller 15
Jason HardyJason Hardy
Hi Becky, just for giggles and grins create a text formula field on that object that uses the following:
IF(NOT(q.IsProcedural__c),'Actual Sales','Invoiced')
Then try using that field as the header value instead. 

All Answers

Maharajan CMaharajan C
Hi Becky,

Try the below Code : 

<apex:column headerValue="Actual Sales"> 
     <apex:outputText value="{!q.Annual_Actual_Sales__c}" style="width:70px"  rendered = "{!IF(!q.IsProcedural__c,true,false)}">
     </apex:outputText>
</apex:column>


If the above code not works then please try to change the if condition as {!IF(q.IsProcedural__c,true,false)} because you are using the not condition soi can't predicate the exact scenarion you are using if the above code works then leave it simply.

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!


Thanks,
​Raj
Becky Miller 15Becky Miller 15
The Actual Sales is coming up for both set of users still.  With or without the !.

I have looked on the Quota Field and one field is checked and one field is not checked.  
Jason HardyJason Hardy
I think you're over thikning things. If you just nee the column heading to be different, then you should be able to do some formula level manipulation on the header value:
<apex:column headerValue="{!IF(NOT(q.IsProcedural__c),'Actual Sales','Invoiced')}">
    <apex:outputText value="{!q.Annual_Actual_Sales__c}" style="width:70px" />
</apex:column>
It should be workable like that instead of trying to do a rendered vs not rendered 
 
Becky Miller 15Becky Miller 15
Jason, I would agree I was over thinking.  I have looked at the data and IsProcedural__c is checked or not checked correctly.  But, I still get Invoiced for both of the users.  I do not get it.
Jason HardyJason Hardy
Hi Becky, just for giggles and grins create a text formula field on that object that uses the following:
IF(NOT(q.IsProcedural__c),'Actual Sales','Invoiced')
Then try using that field as the header value instead. 
This was selected as the best answer
Maharajan CMaharajan C
Hi Becky,

Did you have one checkbox field or two checkbok field in the object because you mention like this below ?

I have looked on the Quota Field and one field is checked and one field is not checked.

Thanks,
​Raj