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
Arthur AlmeidaArthur Almeida 

public page visualforce don't work

I created a public site for my visualforce. On my page, I'm don't using Apex class, just Visualforce.
 
My page:
 
<apex:page standardController="Curso__c" recordSetVar="cursos">
    <apex:pageBlock title="Plataforma de Cursos do Mario">
        <apex:form >
            <h1> Bem vindo, escolha um curso e bons estudos! </h1>
            <br/><br/>
            <apex:pageBlock title="Cursos Disponíveis:">
                <apex:repeat value="{!cursos}" var="curso">
                    <h1>Nome: {!curso.Name}</h1>
                    <br/><br/>
                    <apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
                        Data do curso:<apex:param value="{!curso.CreatedDate}" /> 
                    </apex:outputText>
                    <p></p>
                    <apex:image value="{!curso.Link_da_Imagem_do_Curso__c}" width="350px" height="200px" />
                    <p>{!curso.Descri_o_do_Curso__c}</p>
                    <br/>
                    <button type="button" onclick="location.href='{!curso.Link_do_Curso__c}'">ACESSAR CURSO</button>
                    <hr/>
                    <br/><br/>
                </apex:repeat>
            </apex:pageBlock>
        </apex:form>
    </apex:pageBlock>
</apex:page>

In Developer Console -> preview, my page works and she lists my Courses (list of Curso__c) !
 
User-added image

But on my public site, the list doesn't work... 

User-added image

This is a link for my public site: https://cursosmario-developer-edition.na156.force.com/
 
He doesn't list my Courses... Why?? Please, help me
Best Answer chosen by Arthur Almeida
Arthur AlmeidaArthur Almeida
thank you, guys!!!
you helped me 
this link solved my problem https://trailhead.salesforce.com/pt-BR/trailblazer-community/feed/0D54S00000BcmP6SAJ

All Answers

ryanschierholzryanschierholz
When you're signed in, you have access to view the Curso__c object and records. The anonymous guest user likely does not have access to view them, so you need to change the permissions to make that object readable by the public, anonymous, guest user. 
Suraj Tripathi 47Suraj Tripathi 47
Hi Arthur Almeida,

You have an access issue, the anonymous guest user likely does not have access to view them. you need accessibility for the public site.
you can get help from this:
https://help.salesforce.com/articleView?id=sf.users_profiles_visualforce_access.htm&type=5

---------------
If you find your Solution then mark this as the best answer to close this question. 

Thank you!
Regards,
Suraj Tripathi
Arthur AlmeidaArthur Almeida
thank you, guys!!!
you helped me 
this link solved my problem https://trailhead.salesforce.com/pt-BR/trailblazer-community/feed/0D54S00000BcmP6SAJ
This was selected as the best answer