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
Reppin__505Reppin__505 

Force.com Sites using Visual Force Logical Functions

Is it not possible to use Logical Functions in force.com sites?

 

I have a visual force page that is displayed as a public site. The page has an If Statement that shows a list of record names if they are of a certain type. This works great when viewing the page as a visualforce page logged into the org.

 

However when viewing as a public site, i don't get an error, i simply do not get the list returned as if the 'If Statement' is conflicting with the public page.

 

I tried adding the apex java script pages to the visual force page. But still no go.

 

<apex:page standardController="Course__c" recordSetVar="course" showHeader="false" standardStylesheets="false" >
<apex:includeScript value="http://cs1.salesforce.com/soap/ajax/17.0/connection.js"/>
<apex:includeScript value="http://cs1.salesforce.com/soap/ajax/17.0/apex.js"/>
<apex:includeScript value="http://cs1.salesforce.com/static/121310/js/functions.js"/>
<apex:includeScript value="http://cs1.salesforce.com/jslibrary/1309972098000/JiffyStubs.js"/>

<h2>Classroom Courses</h2>

<apex:repeat value="{!course}" var="c">
  <apex:outputText rendered="{!IF(contains(c.Classroom_Type__c, 'Classroom'),'true','false')}"><p class="style1"><a href="http://cs1.force.com/coursedescription?Id={!c.Id}"><apex:outputField value="{!c.Name}"/></a></p></apex:outputText>
  
</apex:repeat>

<dl class="st_text_1 indent_box"><dd>&nbsp;</dd><dd><h3 class="style2">Online Courses</h3></dd></dl>
<apex:repeat value="{!course}" var="c">
  <apex:outputText rendered="{!IF(contains(c.Classroom_Type__c, 'Web'),'true','false')}"><p class="style1"><a href="http://cs1.force.com/coursedescription?Id={!c.Id}"><apex:outputField value="{!c.Name}"/></a></p></apex:outputText>
</apex:repeat>

</apex:page>

 Any ideas?

 

Thanks for your help.

Ankit AroraAnkit Arora

Just confirm me that when you remove the condition from visualforce page and try to hit it from both places then what is the exact results. If you are still unable to see the result that means nothing wrong with the condition, there might be a permission issue.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

EIE50EIE50

Hi,

 

This is definitely a permission issue. Check your permissions for Site guest user profile, and grant access to the objects and fields to the profile. You should be good to go.

 

Just in case if you dont find the user profile, this is where you need to go,

 

Site detail page -- public access setting .

 

Thanks.

Reppin__505Reppin__505

Unfortunately this is not a permission issue. Visualforce functions do not work on salesforce sites. Unless there's some permission setting for using visualforce functions on salesforce sites that i am unaware of.

EIE50EIE50

I am not sure what you are saying... I have done it few months back in our site.

 

Here is a sample line of code i am pasting,

 

<apex:outputpanel rendered="{!if(es.LinkText='Cancel',false,true)}">

I dint have any such problem with the rendering on site.