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
akousikaakousika 

Dynamic values to display in the sites

Hi All,
I have created a salesforce web site successfully but i am not able to show the values which are in organization object.
In VF page its working fine but the same code in site page is not working......can any one suggest me the best way
to display the object record details on the site.

code goes here

page
-------
<apex:page showHeader="false" controller="pdftets" >
<script>
function fun(a)
{
var s=new String(a);
// alert(s);
window.open(s);
}
//window.parent.location.href =s;}

</script>
<apex:form >
<apex:composition template="{!$Site.Template}">
<apex:define name="body">
<table style="width: 181px">
  <tr>
    <td>   
    <apex:dataTable value="{!accounts}" var="account" id="theTable" width="100%" columns="3">
        <apex:facet name="header">Real Estate News</apex:facet>               
                <apex:column width="60%">

 


                 <apex:facet name="header">Article</apex:facet>
                    <a href="#" onclick="fun('{!account.Document_URL__c}')" >{!account.name}</a>
                </apex:column>
                <apex:column width="10%">
                        <apex:facet name="header">Source</apex:facet>
                          {!account.Source__c}
                </apex:column>                
                 <apex:column width="20%" >
                   <apex:facet name="header">Date </apex:facet>
                <apex:outputText value="{!account.CreatedDate}"/>
                </apex:column>
        </apex:dataTable>
    </td>
  </tr>
</table>

</apex:define>
</apex:composition>
</apex:form>       
</apex:page>

controller
--------------
public with sharing class pdftets {
  List<News_and_Events__c> NewsandEvents1;
        public List<News_and_Events__c> getAccounts() {
       NewsandEvents1= [select name,Source__c,CreatedDate,Document_URL__c from News_and_Events__c limit 10];

                return NewsandEvents1;
        }
 public string Rctype{get;set;}

}

Pradeep_NavatarPradeep_Navatar

Have you checked the public access setting of the site? Check whether the fields related to the object are visible in guest user profile.

akousikaakousika

Hi  pradeep_Navatar ,

 

Thanks for the reply I checked with the public access setting of the site. Checked whether the fields related to the object are visible in guest user profile, after giving the permetions its not working .

 

Thanks & warm regards

Adithay k

RyanGuestRyanGuest

While your testing, disable the cache on your visualforce pages by putting this after apex:page

 

cache="false" expires="0"

 

Also check the field level security for your custom fields.

akousikaakousika

 Hi ryan,

             I Checked the field level security for custom fields., and i added cache="false" expires="0" but their is no result Please Help As soon as Possible

 

<apex:page showHeader="false" cache="false" expires="0" Controller="pdftets">

 

Thanks

Adithya K

 

 

RyanGuestRyanGuest

Do you get an error message or is something displayed on the page?

 

What happens if you use the "Preview as Admin" link on the site detail page and then view the site?

akousikaakousika

 Hi ryan,

 while right now i am not getting any  errors on page, and when i check  with "Preview as Admin" link from the site lable

it displaying the same static information same as before.

 

Adithyak

 

 

 

 

 

akousikaakousika

Hi All,

   Any one please help unable to get the dinamic values in the site i checked field level security  and i kept cache="false" expires="0" 

 

<apex:page showHeader="false" cache="false" expires="0" Controller="pdftets">

 

But their is no use i am unable to get the values please find the solution as soon as possible

 

WarmRegards,

Adithya k