You need to sign in to do that
Don't have an account?
How to display just the variable != NULL
Hello everybody,
I want to know the way of using condition in visualforce page. I have a custom object 'Stagiaire__c' having few fields:Name,CNE,e-mail,date_de_naissance,Téléphone
I want to create a PDF documents whish display just the fields are not NULL
if for exemple,"CNE == null" , <p> CNE: </p> will not display in my PDF
Here is my code:
<apex:page standardController="Stagiaire__c" renderas="pdf" showheader="false" applyhtmltag="false" >
<apex:pageBlock title="Fiche Stagiaire">
<apex:pageblockTable value="{!Stagiaire__c}" var="s">
<p>Nom & Prénom: </p> <apex:column value="{!s.Name}"/>
<p>CNE:</p> <apex:column value="{!s.CNE__c}"/>
<p>Téléphone! </p> <apex:column value="{!s.Téléphone__c}"/>
<p>E-mail: </p> <apex:column value="{!s.e-mail__c}"/>
</apex:pageblockTable>
</apex:pageblock>
</apex:page>
should I create an apex Class ? if yes , how I will relate it to my page Visualforce?
Try below code
Regards,
Bhanu Mahesh
Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
See deepak's post
https://success.salesforce.com/apex/answers?id=90630000000CtngAAC&feedtype=SINGLE_QUESTION_DETAIL&dc=Email&criteria=BESTANSWERS&
This will help you.
Also for your code Mr Himanshu Parashar I get this error : ""Error: <apex:column> doit être l'enfant direct de <apex:dataTable> ou de <apex:pageBlockTable>""
Try this
Regards,
Bhanu Mahesh
Error: <apex:column> doit être l'enfant direct de <apex:dataTable> ou de <apex:pageBlockTable>