• Roger Bannister 21
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Ok, so I successfully got a VF Page Form to show on my Force.com site , anyone can go to the URL and see the form , even fill it in BUT when you hit "Save" you get the following error message: "Authorization Required-You must first log in or register before accessing this page.If you have forgotten your password, click Forgot Password to reset it."

I have confirmed the guest user permissions are set properly on the Custom Object and in the OWD settings , I have been researching , reading and watching videos for the last week but I have been unable to determine what the problem is. Attached is the code for the VF page.

I think it's something to do with using "standardController" maybe I need a custom controller to make this work - anyone have any suggestions?
<apex:page standardController="Loyalty_Program_Member__c">
<apex:messages />
    <apex:form id="changeStatusForm">
        <apex:pageBlock >
          <apex:pageblocksection title="Loyalty Program Member Detail">
               <apex:inputfield value="{!Loyalty_Program_Member__c.First_Name__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Last_Name__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Full_Name__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Street_Address__c}"/>
        <apex:inputfield value="{!Loyalty_Program_Member__c.City__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Province_State__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Country__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Postal_Zip__c}"/>
        <apex:inputfield value="{!Loyalty_Program_Member__c.Home_Phone__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Mobile__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Email__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Type_of_Pet__c}"/>
        <apex:inputfield value="{!Loyalty_Program_Member__c.Product_Purchased__c}"/>
        </apex:pageblocksection>
        <apex:pageblocksection title="Retailer Information">
             <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Name__c}"/>
             <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Address_Street__c}"/>
        <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Address_City__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Address_State_Province__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Address_Country__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Address_Postal_Zip__c}"/>
        <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Phone__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Fax__c}"/>
               <apex:inputfield value="{!Loyalty_Program_Member__c.Retailer_Email__c}"/>
        </apex:pageblocksection>
        <apex:pageBlockButtons >
             <apex:commandButton value="Save" action="{!save}"/>
        </apex:pageBlockButtons>
       </apex:pageBlock>
    </apex:form>
</apex:page>

Thanks, Roger