You need to sign in to do that
Don't have an account?

regarding Sites
Hi to all,
I have 2 questions.,
I am creating a site to call the Visual force page.
The visual force page contains system objects like Contacts.,
Now i am added two fields of contact
My first question How to add Visual force page to "Contacts related list of Notes & attachments"
&
the second question is,
I am connected visualforce page to SITES. & run the specific URL,
& save the two filelds to contact it shows the below error message. but the values are added to contacts.
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.
How to handle this one?????
my sample code is:
<apex:page standardController="Contact">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton action="{!Save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel id="lastname" value="Last Name" for="Visual">
</apex:outputLabel>
<apex:inputText value="{!Contact.lastname}" />
</apex:pageBlockSectionItem>
</apex:pageblockSection>
<apex:pageblockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel id="Department" value="Department" for="visual"></apex:outputLabel>
<apex:inputText value="{!Contact.Department}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
For #1 there is a similar example in Force Platform Developer Guide Chapter 14
For #2 you need to go to setup> app setup>create>objects and then overwrite the view action with your own visualforce view page
All Answers
I'm guessing that you are using the standard controllers for your visualforce page.
the default save action of the standard controller is to save the record and show the record details page. The details page is a standard page, not a visualforce page, and you can not expose standard pages via sites (only visualforce pages).
You have 2 options:
1- extend the standard controller so that you can capture the save action and after save redirect to your own visualforce page (this option applies to only your specific site)
2- overwrite the save action on the object definition so that save will be handled by the visualforce page (this option applies to all profiles + sites).
For #1 there is a similar example in Force Platform Developer Guide Chapter 14
For #2 you need to go to setup> app setup>create>objects and then overwrite the view action with your own visualforce view page