You need to sign in to do that
Don't have an account?
Data in table working fine in VisualForce page, NOT showing in sites
I have a data table exposing Opportunity fields on a visual force page. It works fine within Salesforce. I created a site, set the page as the home page for my site, and no data shows. The page title and column headers show fine, so I know it's not a security issue with the entire page.
I have set the field accesibility of every field I am referencing, used the Public Access button to make sure the opportunities object is readable, and checked everything I can think of.
The only thing that I can imagine is affecting this is that I am using record types on Opportunities, but I can't find any settings to change behavior based on record types. My visual force code doesn't reference record types at all, and all records are shown when I access the page within salesforce.com
Any suggestions would be greatly appreciated - I'm excited about getting my first site up and running, and if I can't expose data it won't be much use!
the problem is the RecordSetVar attribute. I believe it's automatically using the latest list view definition on the related object. And for Site there is no latest used list view definition.
I recommend using a custom controller
All Answers
Sharing Settings on Opportunity are set to Public Read/Write.
I changed one of the columns in my table to present static text, and it had no effect on the table in sites but I saw the change within sfdc. Here's my code:
<apex:page standardStylesheets="false" showHeader="false" sidebar="false"
standardController="Opportunity" recordSetVar="items">
<apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}" />
<h1>Auction Catalog</h1>
<br/><br/>
<apex:dataTable value="{!items}" var="pitem">
<apex:column headerValue="Item Number">
<apex:outputText value="{!pitem.Item_Number__c}"/>
</apex:column>
<apex:column headerValue="Item Name">
<apex:outputText value="{!pitem.name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:outputField value="{!pitem.Description}"/>
</apex:column>
</apex:dataTable>
<br/>
</apex:page>
I'm no longer thinking that this is a security issue. I modified my page NOT to use RecordSetVar, instead to look at a single record passed in via URL parameter. This exposes the data just fine:
<apex:page standardStylesheets="false" showHeader="false" sidebar="false"
standardController="Opportunity" >
<apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}" />
<h1>Auction Catalog</h1>
<p>Name:
<apex:outputField value="{!opportunity.name}"/> <br/>
Description:
<apex:outputField value="{!opportunity.description}"/>
</p>
</apex:page>
So I think I'm doing something wrong with the list of all opportunities... any suggestions greatly appreciated!
Site allows you create and read Standard Objects (except products, price books and ideas: you only get read access).
You would need to authenticate the site visitors with customer or partner portal in order to get additional (edit/delete) access on standard objects.
OK - I have MASSIVELY simplified what I am trying to do and am still having trouble.
Statement of problem:
Custom Object Catalog_Item__c
Trying to display a list of all records on site. Permissions is set appropriately. Can see data from logged in (ie na7.salesforce.com/apex/Catalog) but see NO data on site (bnai-shalom.force.com/catalog)
When I make a single record page and specify an ID, I CAN see data from the site (so I don't think it is a permissions problem)
I am only using outputText, so I don't think it is an authentication problem.
PLEASE HELP!!!
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" standardController="Catalog_item__c" recordSetVar="items"> <apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}" /> <h1>Auction Catalog</h1> <apex:dataTable value="{!items}" var="pitem" > <apex:column headerValue="Item Number"> <apex:outputText value="{!pitem.Item_Number__c}"/> </apex:column> <apex:column headerValue="Item Name"> <apex:outputText value="{!pitem.Item_Title__c}"/> </apex:column> </apex:dataTable> </apex:page>
the problem is the RecordSetVar attribute. I believe it's automatically using the latest list view definition on the related object. And for Site there is no latest used list view definition.
I recommend using a custom controller
So why is this exactly how the force.com workbook explains to make a site? - Tutorial #8 displays a list of products by using a recordsetVar.
I guess I can write my own controller, but this is so tantalizing - why can't it just work the way it's documented?
Thanks all
Go to Setup/Develop/Sites
Click the label of your Site
Click the Public Access Settings button
Make sure you are including all the fields you need to display or access in the SOQL query in your controller!
Good luck,
Emily