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
King KooKing Koo 

var in <apex:repeat> is case sensitive on me......

Hi there

This is weird..  Never thought I've encountered that before.  Is it new...?

The following code works, just as you would expect.

<apex:page standardController="account">
    <apex:repeat value="{!account.contacts}" var="CONTACT">
        <apex:outputField value="{!CONTACT.name}" />
    </apex:repeat>
</apex:page>

However, if I change the outputField to this (only hanged the apex:outputField line),

<apex:page standardController="account">
    <apex:repeat value="{!account.contacts}" var="CONTACT">
        <apex:outputField value="{!contact.name}" />
    </apex:repeat>
</apex:page>

I got this error mssage:
Error: Unknown property 'AccountStandardController.contact'

This is really against what I have believed for a long time that VF is case insensitive.

Has anyone else seen this before?

Note:  I originally had var="Contact".  My above code, var="CONTACT", is simply for illustrations.

Thanks
king
King KooKing Koo
Oh guys, by the way,
if I had 
<apex:repeat value="{!account.contacts}" var="contact">
though,

I then can have
<apex:outputField value="{!CONTACT.name}" />

So, it's like, if my var in the <apex:repeat> has a capital letter, then the "value" must follow.  If the var has a lower case in <apex:repeat>, then it doesn't matter what you have for the "value" attribute within the loop.  Very strange.

Damien Phillippi033905702927186443Damien Phillippi033905702927186443
Unfortionately, you will find a lot of descrepencies in Salesforce.  There really is no good explanation for that.

The only piece of advice I can give you though is you should try not naming a variable the same name as an object.  Eventually you will likely run into some issue that will be because of it but waste a lot of time trying to debug.  (I know this from experience.)
Manisha Yadav 27Manisha Yadav 27
https://th3silverlining.com/2009/06/22/force-com-case-sensitivity/#comment-21552

If someone is still facing this case sensitive and case insensitive dilemma then you can visit this link. They have listed a few things which are case sensitive in salesforce, which proves that it is not completely case-insensitive.