0

This is my VF outputtext which works fine:

<apex:repeat value="{!port.hList}" var="per">
  <tr>
     <td>
       <apex:outputText value="{0, Number, #,###,###.00}" rendered="{!per.unit__r.listing__r.value__c != 0}">
         <apex:param value="{!per.unit__r.listing__r.value__c}"/>
       </apex:outputText>
      ....

When I change the != to > or <, it fails. The field being checked is a formula(Currency) field which should allow <> checks surely?

I want to add formatting based on whether the value is negative (ie put brackets around the value), but because the < fails, I can't do this. Anyone have any ideas why?

2
  • I discovered the value = null, which is why it's failing. If I add a null check before the > then it works.
    – Irene
    Commented Jan 13, 2020 at 2:28
  • 2
    Irene, please post an answer to your question as a service to the community
    – cropredy
    Commented Jan 13, 2020 at 4:18

1 Answer 1

0

If the value of the field in the comparison is null, then == and != still work, but > or < causes an error. As the check is in VF, I added an additional check in the rendered section for null value like this:

<apex:outputText value="{0, Number, #,###,###.00}" 
    rendered="{!per.unit__r.listing__r.value__c != null 
                && per.unit__r.listing__r.value__c < 0}">

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .