You need to sign in to do that
Don't have an account?
Tyler Harris
Public Site/Visualforce Page won't let a guest user submit data
My visualforce page on my Public Site will not allow a guest user to submit data to my salesforce instance. Once I hit submit it throws a "authorization is required" page.
Visualforce:
<apex:page standardController="Lead" standardStylesheets="true" sidebar="false" cache="true" showHeader="false" showChat="false" >
<apex:pageBlock title="Do You Love Me?">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:form >
<apex:pageBlock mode="edit" >
<apex:pageBlockSection >
<apex:inputText value="{!Lead.FirstName}" label="First Name"/>
<apex:inputText value="{!Lead.LastName}" label="Last Name"/>
<apex:inputText value="{!Lead.Email}" label="Email Address"/>
<apex:inputText value="{!Lead.Company}" label="Where you work?"/>
<apex:inputCheckbox value="{!Lead.Love_Your_Hubby__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandButton action="{!Save}" value="Let me know how you feel"/>
</apex:form>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pagemessages escape="true" rendered="true"></apex:pagemessages>
</apex:page>
Visualforce:
<apex:page standardController="Lead" standardStylesheets="true" sidebar="false" cache="true" showHeader="false" showChat="false" >
<apex:pageBlock title="Do You Love Me?">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:form >
<apex:pageBlock mode="edit" >
<apex:pageBlockSection >
<apex:inputText value="{!Lead.FirstName}" label="First Name"/>
<apex:inputText value="{!Lead.LastName}" label="Last Name"/>
<apex:inputText value="{!Lead.Email}" label="Email Address"/>
<apex:inputText value="{!Lead.Company}" label="Where you work?"/>
<apex:inputCheckbox value="{!Lead.Love_Your_Hubby__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandButton action="{!Save}" value="Let me know how you feel"/>
</apex:form>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pagemessages escape="true" rendered="true"></apex:pagemessages>
</apex:page>
Barring that, in the Site - hit the "Preview as Admin" link and see if you can get some more detail on that error...or you can also do the "Debug Log" as the Guest user to get more information that way too.
I got two corresponding triggers that are firing before insert and after insert when a lead hits the system.
Trying to get more familiar with the system and sites in general.