You need to sign in to do that
Don't have an account?
Ramesh Somalagari
Authorization Required
I have created simple site that create a new case.
Note :
- I have given the Site permissions Visualforce page,Controller ,Lead Object and Case Object.
- While execute the site Lead is created similarly I tried to create a new case it not happens.
- I have given the case Object create permission but why it is not created
Can someone please help me.
While executing the site it showing the error:
**Visualforce Page**
<apex:page controller="Controller" action="{!init}" showHeader="false" sidebar="false">
<center>
<apex:pageBlock title="Request Listener"></apex:pageBlock>
</center>
</apex:page>
**Controller :**
public with sharing class Controller
{
public PageReference init()
{
try
{
// Lead l1 = new Lead(FirstName='first name1',LastName = 'lead last name',phone ='9876543210');//testing
//insert l1; testing
Case c = new Case(Subject = 'Subject Test',Description ='Description Test');
insert c;
}
}
catch(exception e){}
RETURN null;
}
}
Note :
- I have given the Site permissions Visualforce page,Controller ,Lead Object and Case Object.
- While execute the site Lead is created similarly I tried to create a new case it not happens.
- I have given the case Object create permission but why it is not created
Can someone please help me.
While executing the site it showing the error:
**Visualforce Page**
<apex:page controller="Controller" action="{!init}" showHeader="false" sidebar="false">
<center>
<apex:pageBlock title="Request Listener"></apex:pageBlock>
</center>
</apex:page>
**Controller :**
public with sharing class Controller
{
public PageReference init()
{
try
{
// Lead l1 = new Lead(FirstName='first name1',LastName = 'lead last name',phone ='9876543210');//testing
//insert l1; testing
Case c = new Case(Subject = 'Subject Test',Description ='Description Test');
insert c;
}
}
catch(exception e){}
RETURN null;
}
}
I have tested with same code as you return. Its working fine for me.
For site home page i have used that VF page.
Thanks
Can you tell me how many security levels are accessible to for the site URL.
I need to check all permissions for Case Object .Then Case Object Field Level Security and Object Level security for the site url .
Can you tell me what permmission should give for case Object?
You can give all the permissions. and see on the site profile.
Good..
While execute the same code I got a exception
Exception: System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
How to re-solve the exception?