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
PrakkiPrakki 

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 (user1email@gmail.com), User2Name ( User2email@gmail.com).
 
the condition here is when there is no user2, filed value should be user1 Name (user1email@gmail.com)

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 ?

Thanks,
Prakki
Anoop yadavAnoop yadav
try this.

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

PrakkiPrakki
Thanks for reply,

Didn't worked.  I got Syntacticall error


Anoop yadavAnoop yadav
Hi,

Can you put that error.
rohitsfdcrohitsfdc
Prakki,
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
rohitsfdcrohitsfdc
If that doesnt help, please share the controller code and the error message