function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SK R.ax1448SK R.ax1448 

Insufficient Privileges for system adminstrator

Hi All,

 

I have a custom button on my VF page  which display all the acitivities, when i clicked on button I am getting the following the error.

 

Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

Click here to return to the previous page.

 

I am a System Admin, even though getting the above error msg. Any help must be appreciated.

 

 

Thanks in advance,

SK

 

Devendra@SFDCDevendra@SFDC
Hi,

Check the Object level permission, field level security also the sharing setting if any.

Thanks,
Devendra
SK R.ax1448SK R.ax1448

Thanks for the reply Devendra.


As an admin, I have all the permission on object level. Here is the code snippet for better understanding of the issue

 

VF:

<apex:pageblockButtons location="top">
                     <apex:commandButton action="{!ViewAll}" value="ViewAll" />

</apex:pageblockButtons>

 

Controller:

 

public PageReference viewAll(){
        PageReference pref= new PageReference('/ui/core/activity/ViewAllActivityHistoryPage?retURL=%2F'+cid+'&id='+cid);
        pref.setRedirect(true);
        return pref;
   }

 

 

Thank you.

PremanathPremanath

Check your version settings of your VF page and Apex class.

 

if  Version setting of both class and vf page are Different it will error.

 

 

Prem

SK R.ax1448SK R.ax1448

Thanks for the reply prem. Both are same version.

 

Thanks

SK R.ax1448SK R.ax1448

My question is, is it possible to access activity/ViewAllActivityHistoryPage from controller ?

 

PageReferece pref = new PageReference('/ui/core/activity/ViewAllActivityHistoryPage?retURL=%2F'+cid+'&id='+cid);

PremanathPremanath

Yes Possible..

 

Do it properly.. You can achive

SK R.ax1448SK R.ax1448

Anything wrong in the following code ?

 

<apex:pageblockButtons location="top">
                     <apex:commandButton action="{!ViewAll}" value="ViewAll" />

</apex:pageblockButtons>

 

Controller:

 

public PageReference viewAll(){
        PageReference pref= new PageReference('/ui/core/activity/ViewAllActivityHistoryPage?retURL=%2F'+cid+'&id='+cid);
        pref.setRedirect(true);
        return pref;
   }

 

Thanks,

SK

Prafull G.Prafull G.
There is nothing wrong with the code. I tried the same in my dev org and its working fine.

Can you look at the url where you getting the insufficient privileges error? That may give us some hint.

Regards,
SK R.ax1448SK R.ax1448

Hi,

 

Im getting error in the Sandox and Production instance as well. I have overridden Activity History related list of Case to remove action buttons (Delete). It is working as expected if i added standard Activity related list along with new one, if I remove standard related list again getting insufficient privileges.

 

Thanks & Regards,

SK