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

apex:outputtext error, change the field value dynamically

Hi All,

There is a output text field in my VF page, the value of the text should be like this user1 Name (, User2Name (
the condition here is when there is no user2, filed value should be user1 Name (

I'm using the following condition 

<apex:outputText value="{!if({!EndUserName} != null && {!EndUserEmail} != null),{!ContactName} ({!ContactEmail}) {!EndUserName} ({!EndUserEmail}), {!ContactName} ({!ContactEmail}) }"/>

here endUsername = user2name, EndUserEmail = user2email.

but i'm getting an error : User-added image

Any suggestions how to implement this ?

Anoop yadavAnoop yadav
try this.

<apex:outputText value="{!IF( (EndUserName != null && EndUserEmail != null), (ContactName & ContactEmail & EndUserName & EndUserEmail), 
(ContactName & ContactEmail))}"/>

Thanks for reply,

Didn't worked.  I got Syntacticall error

Anoop yadavAnoop yadav

Can you put that error.
All the variables you referenced in the code, are they controller variables or system fields. If system fields, please add __c or Objectname.fieldname__c in the code
If that doesnt help, please share the controller code and the error message