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
AnjaanAnjaan 

INSUFICIENT_ACCESS RIGHTS ON INVOKING A CLASS

I am writing a s control, in this scontrol i am invoking a web service. when i run it in my developer's account it runs fantastic but when i make the package and deploy it on any other account including developer i get an error msg:

 

{faultcode:'sf:INSUFFICIENT_ACCESS', faultstring:'CTCTEmailHistoryBO: no access allowed to this class.', }

 

 

Here is the javascript scontrol code:

<html> <head> <script type="text/javascript" src="/js/functions.js"></script> <script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script> <script type="text/javascript" src="/soap/ajax/10.0/apex.js"></script> <script type = "text/javascript"> function getNextList(){ var pageCounter = document.getElementById('pageCounter'); pageCounter.value++; var id = '{!Contact.Id}' var sDiv = document.getElementById('sDiv'); sDiv.innerHTML = sforce.apex.execute('CTCTEmailHistoryBO','nextList',{arg:id,arg1:pageCounter.value}); } function getPrevList(){ var pageCounter = document.getElementById('pageCounter'); if(pageCounter.value >0){ pageCounter.value--; var id = '{!Contact.Id}' var sDiv = document.getElementById('sDiv'); sDiv.innerHTML = sforce.apex.execute('CTCTEmailHistoryBO','prevList',{arg:id,arg1:pageCounter.value}); }else{ alert("No Lists Found"); } } </script> </head> <body style="background-color:#F3F3EC"> <div width = "100%"align="center" id = "sDiv" > <input type="hidden" value="0" id="pageCounter" /> </div> <script type = "text/javascript"> try{ var pageCounter = document.getElementById('pageCounter'); var id = '{!Contact.Id}' var sDiv = document.getElementById('sDiv'); sDiv.innerHTML =sforce.apex.execute('CTCTEmailHistoryBO','getListHTML',{arg:id,arg1:pageCounter.value}); }catch(Error){ alert(Error); } </script> </body> </html>

 Its really urgent please help me

 

Osman Ashraf Bajwah

Technosoft

 

 

 

aalbertaalbert

It looks like that profile doesn't have access to that specific apex class. Make sure that the Apex Class has been enabled on all the Profiles that need to execute the Class.Go to Setup->App Setup->Develop->Apex Classes. Then click on Security link next to the Class you are trying to execute. And include all the Profiles that need access. 

 

AnjaanAnjaan

There is no such issue regarding profile access rights. I havemangaed to understand the problem. I am using some describe objects in my code. In order to get thier functionality right I have to enable restrictions. If i do so this does not work and the other (describe) functionality works and if i disable the restrictions this functionality works and the other don't. Can anyone help me and guide me so that both functionalites work.

 

Thanks and Osman Ashraf Bajwah

Technosoft Solutions (pvt) Ltd.