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
ShmeeShmee 

Weird Bug in Sites?? Any Help?

So I have created my first site.  I have configured login and customer portal access.  everything is working great.

 

EXCEPT...

 

in my controller I am creating a list of reservations

 

 

List<reservation__c> reservations = [SELECT id, name, Departure_Time__c, Return_Time__c, allDay__c, Required_Services__c, Notes__c FROM Reservation__c WHERE Account__c =: getAccountID() ORDER BY Name];

 

 I am displaying that list in my visual force page

 

 

<apex:repeat value="{!reservations}" var="i" id="reservationList"> {!i.allday__c} </apex:repeat>

 

 

 allDay__c is a Checkbox (boolean)

 

When I login as a regular salesforce user (not through customer portal) and run the page all my reservations return TRUE for allDay__c (which is correct according to their value in the database)

 

When I login as a customer portal user (through the customer portal i setup through sites) and run the page, all my reservations return FALSE for allDay__c (which is NOT correct according to their value in the database)

 

So as I was playing around I tried manually setting the value of the field after I retrieved it from the DB.  Still same thing. All values display false.

 

MY WORK AROUND: I ended up creating a Wrapper class and assigning the value of allDay__c to a Boolean inside the Wrapper.  I then read the value from the wrapper in Visualforce.  This Worked.

 

Kind of weird huh?  Any light on this subject would be awesome.

 

Thank You

 

 

Best Answer chosen by Admin (Salesforce Developers) 
David VPDavid VP

A Boolean can only have true or false value, not null.

If it isn't initialized it defaults to false. You probably have field visibility settings that don't allow the anonymous users to see that field and that's why it just returns 'false'.