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
@GM@GM 

How to put condition in table row for Visualforce Template

I have to display this tr only when there is a value in EOL_Info__c field in VF TEmplate

but for the following code i'm getting sytax error and if i remove (!) before IF then it will get save but wont work.

<tr style="display: {!IF((ISBLANK({!relatedTo.PRM_EOL_Info__c})), 'none', 'table-row')};">
                    <td>EOL Info:</td>
                    <td>{!relatedTo.EOL_Info__c}</td>
</tr>

Please suggest some solution

Thanks in advance

Regards,
GM
Best Answer chosen by @GM
Vivek_PatelVivek_Patel
Hi GM,

Please try with below code, I have removed the expressions around relatedTo.PRM_EOL_Info__c field. That is not needed if you have already started the expression.

<tr style="display: {!IF((ISBLANK(relatedTo.PRM_EOL_Info__c)), 'none', 'table-row')};">
                    <td>EOL Info:</td>
                    <td>{!relatedTo.EOL_Info__c}</td>
</tr>

Regards,
Vivek Patel

Please mark this best answer if it solves you problem.
 

All Answers

Vivek_PatelVivek_Patel
Hi GM,

Please try with below code, I have removed the expressions around relatedTo.PRM_EOL_Info__c field. That is not needed if you have already started the expression.

<tr style="display: {!IF((ISBLANK(relatedTo.PRM_EOL_Info__c)), 'none', 'table-row')};">
                    <td>EOL Info:</td>
                    <td>{!relatedTo.EOL_Info__c}</td>
</tr>

Regards,
Vivek Patel

Please mark this best answer if it solves you problem.
 
This was selected as the best answer
@GM@GM
Hi Vivek,

Thanks.

Regards,
GM