+ Start a Discussion

Autorization Required page error on click of Edit

Hi I have created the following site, but I am facing some issues in accessing the site:




When I submit the form on the site, I am taken to another page which is controlled by a standard controller. When I click on the edit button, I am taken to the 'authorization required' page although I ahve alredy given the Read, Create and edit permission my my custom object.


I am gacing the same issue when I Try to use the can cel button functionality on the first page, I am using the following code for cancel button:

public PageReference Cancel() {
      if(UserInfo.getprofileid() == '00eQ0000000LrqAIAS'){
           // After Cancel, navigate to the Walmart Website Home Page:
           PageReference pageRef = new PageReference('www.wal-mart.com');
           return pageRef;
           PageReference pageRef = new ApexPages.StandardController(eve).cancel();
           //new PageReference('/'+aId);

           return pageRef;

Can anybody please provide some pointers on this?




Best Answer chosen by Admin (Salesforce Developers) 

with sites you can only expose visualforce pages (except couple of standard pages:search, lookup and home page).

Standard controller actions would by default take you to standard pages unless if you extend your controller and capture actions and navigate to your custom visual page, or if you overwrite the action for everyone via the object definition.


You can check the developer guide chapter 14 for an example on ho to extend the standard controller for this type of use case.