function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Can we use len() in VisualForce...
If yes anyone have an example cause I keep getting:
<apex:page > <apex:outputText value="{!LEN($User.LastName)}"/> </apex:page>
From the error, it sounds like you are passing the wrong data type into the LEN function. LEN only works on strings, not numbers, currency, dates, etc. If I try to use it with an opportunity amount, which is not a string, but currency, like so
<apex:page standardController="opportunity"> <apex:outputText value="{!LEN(opportunity.amount)}"/> </apex:page>
I get the same error. Wrap it in the TEXT function, though:
<apex:page standardController="opportunity"> <apex:outputText value="{!LEN(TEXT(opportunity.amount))}"/> </apex:page>
and I get the output I expect.
<apex:page > <apex:outputText value="{!LEN($User.LastName)}"/> </apex:page>
From the error, it sounds like you are passing the wrong data type into the LEN function. LEN only works on strings, not numbers, currency, dates, etc. If I try to use it with an opportunity amount, which is not a string, but currency, like so
<apex:page standardController="opportunity"> <apex:outputText value="{!LEN(opportunity.amount)}"/> </apex:page>
I get the same error. Wrap it in the TEXT function, though:
<apex:page standardController="opportunity"> <apex:outputText value="{!LEN(TEXT(opportunity.amount))}"/> </apex:page>
and I get the output I expect.