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
Sean NolansSean Nolans 

How can I insert a field label name inside the outcome of an IF statement in a Visualforce output

I have an IF statment inside a  <apex:outputText value= and it works well when I select regular text out put inside " " 
EG this works well 
 <apex:outputText value= "{!IF(order__c.departure_city_qty_price__c >  0, "Includes Departure City Qty Price",  "No Departure city extras" )}" />

However I need to be able to reference a field lable inside of my " " out put
Something like this 
 <apex:outputText value= "{!IF(order__c.departure_city_qty_price__c >  0, "{!order__c.Deal_Option_Purchased__c" )}",  " " )}" />


so the idea is that you get to see the field that is included - make sense ?

See screesnhot for further details

Suggestions would be apprecatied
 screenshot



 
SandhyaSandhya (Salesforce Developers) 
Hi,

Try something like below

<apex:outputText value= "{!IF(order__c.departure_city_qty_price__c >  0, "{!order__c.Deal_Option_Purchased__c }",  " " )}" />

If this helps you, please mark it as solved so that it will be availabe for others as a solution.

Best Regards,
Sandhya