I have created a Force.com site but I can't access a page with it.
VF Page
<apex:page standardcontroller="Case" extensions="CActions" showHeader="false" sidebar="false" applyBodyTag="false" docType="html-5.0">
TEST
</apex:page>
Apex Controller
global class CActions {
public Case caseObj {get; set;}
public CActions(ApexPages.StandardController controller) {
if(controller.getRecord() != null) {
caseObj = [SELECT Id, Type
FROM Case
WHERE Id = :controller.getRecord().Id];
}
}
}
Few checks that I have done :
- The VF page is set as Active Site Home Page on the site.
- Yes, the page is in the Site Visualforce Pages list.
- Access has been granted on the Apex class via Public Access Settings.
- Case object has Read access.
- Read and Edit rights added on field Type.
If I remove
if(controller.getRecord() != null) {
caseObj = [SELECT Id, Type
FROM Case
WHERE Id = :controller.getRecord().Id];
}
, the page works fine on the Force.com site.
Note:
Page works great using .../apex/VFP_Test?id=500N0000004c8ts
Does not work with the Force.com site URL : https:// scrmtest.cs6.force.com/VFP_Test?id=500N0000004c8ts
Tried debugging but no luck:
System.debug('## controller record : ' + controller );
gives me
|USER_DEBUG|[23]|DEBUG|## controller record : ApexPages.StandardController[Case]
System.debug('## controller record : ' + (Case)controller.getRecord() );
does not even appear in the log.
Any issue with my code/settings?
Update : Still need help with this one.