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
The KnightThe Knight 

Insufficient Privileges

Hi,

     I am embedding inline s-control into Leads. The URL s-control calls the visualforce page with Lead Email Id as parameter.
  when the Leads page is loaded I am getting insufficient privilege error.  The source code is attached below. Any help in this would be appreciated.

The URL s-control:

Code:
https://na3.salesforce.com/apex/SquareDrive—email={!Lead.Email}

The VF page:

Code:
<apex:page showHeader="false" sidebar="false" controller="SquareDrive">
<!-- <apex:scontrol controlName="email" ></apex:scontrol>-->
<apex:form >
  <style>
                .activeTab {background-color: #fee6a6; color:#ac6106; background-image:none;font-size: 11px;font-weight: bold;padding:4px 8px 4px 8px;text-align:center;text-decoration: none;}
                .inactiveTab { background-color: #e9e9e9; color:#85859f; background-image:none;font-size: 11px;font-weight: bold;padding:4px 8px 4px 8px;text-align:center;text-decoration: none;}
                .x-panel{border-style:solid;border-color:#99bbe8;border-width:0;}
                .x-panel-header{overflow:hidden;zoom:1;color:#15428b;font:bold 11px tahoma,arial,verdana,sans-serif;padding:5px 3px 4px 5px;border:1px solid #99bbe8;line-height:15px;background:transparent url(../images/default/panel/white-top-bottom.gif) repeat-x 0 -1px;}
                .box{height: 100%;width: 75%;}
                .x-panel-body{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;background:white;position:relative;}
                
   </style>
   
   <div style="background-color:white;">
    
    <apex:tabPanel switchType="server" tabClass="activeTab" inactiveTabClass="inactiveTab">
    <apex:tab label="BUZZ" style="background-color:white;">
    <div style="background-color:white;">
    <center>
       <table cellpadding="10" cellspacing="10" width="75%" border="5">
       <apex:repeat value="{!squareData}" var="data">
            <tr>
                <td width="50%" ><apex:outputField value="{!data.Description__c}" /></td>
                
                <td cols="2">
                <apex:image id="theImage" value="{!$Resource.Thumbsup}" width="137" height="103"/>
                <apex:outputField value="{!data.positive__c}" />
                </td>
                
               
            </tr>
        
    </apex:repeat>
           
           <tr>
           <td align="right">
           <apex:commandButton image="{!$Resource.redLight}" action="{!back}"></apex:commandButton>
           <apex:commandButton image="{!$Resource.greenLight}" action="{!next}"></apex:commandButton>
           
           <apex:commandButton image="{!$Resource.mail_image}" action="{!sendEmail}" value="Send Mail">
           </apex:commandButton>
           </td>
           
           </tr>
       </table>
       </center>
    </div>
    </apex:tab>
  
    <apex:tab label="Connections" style="background-color:white;">
    <div style="background-color:white;">
   
    </div>
    </apex:tab>
    <apex:tab label="History" style="background-color:white;">
    <div style="background-color:white;">       
</div>
    </apex:tab>    
    </apex:tabPanel>    
    </div>
    <apex:detail subject="{!$CurrentPage.parameters.email}" relatedList="false" title="false"/>
    </apex:form>    
</apex:page>

The Controller:

Code:
public class SquareDrive {

    public PageReference sendEmail() {
    PageReference p1=new PageReference('/apex/page11');
        return p1;
    }

    String counter='1';
    Integer intCounter;
    public PageReference back() {
    intCounter=Integer.valueof(counter);
     intCounter--;
     counter=String.valueof(intCounter);
        return null;
    }


    public PageReference next() {
     intCounter=Integer.valueof(counter);
     intCounter++;
     counter=String.valueof(intCounter);
        return null;
    }
    List<SquareDrive__c> squareData;

        public List<SquareDrive__c> getSquareData() {
                 squareData= [select Description__c,positive__c from SquareDrive__c where idSquare__c=:counter];
                return squareData;
        }


}

 
 
Thanks in advance.

Joseph
 


DS777DS777
Was this page working last week?
The KnightThe Knight
Now its working fine. I made the necessary changes. I replaced apex:detail with apex:outputtext. The former is to show the record for a given id.

The changed code is shown below in Bold.

Code:
<apex:page showHeader="false" sidebar="false" controller="SquareDrive">
<!-- <apex:scontrol controlName="email" ></apex:scontrol>-->
<apex:form >
<style>
.activeTab {background-color: #fee6a6; color:#ac6106; background-image:none;font-size: 11px;font-weight: bold;padding:4px 8px 4px 8px;text-align:center;text-decoration: none;}
.inactiveTab { background-color: #e9e9e9; color:#85859f; background-image:none;font-size: 11px;font-weight: bold;padding:4px 8px 4px 8px;text-align:center;text-decoration: none;}
.x-panel{border-style:solid;border-color:#99bbe8;border-width:0;}
.x-panel-header{overflow:hidden;zoom:1;color:#15428b;font:bold 11px tahoma,arial,verdana,sans-serif;padding:5px 3px 4px 5px;border:1px solid #99bbe8;line-height:15px;background:transparent url(../images/default/panel/white-top-bottom.gif) repeat-x 0 -1px;}
.box{height: 100%;width: 75%;}
.x-panel-body{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;background:white;position:relative;}

</style>

<div style="background-color:white;">

<apex:tabPanel switchType="server" tabClass="activeTab" inactiveTabClass="inactiveTab">
<apex:tab label="BUZZ" style="background-color:white;">
<div style="background-color:white;">
<center>
<table cellpadding="10" cellspacing="10" width="75%" border="5">
<apex:repeat value="{!squareData}" var="data">
<tr>
<td width="50%" ><apex:outputField value="{!data.Description__c}" /></td>

<td cols="2">
<apex:image id="theImage" value="{!$Resource.Thumbsup}" width="137" height="103"/>
<apex:outputField value="{!data.positive__c}" />
</td>


</tr>

</apex:repeat>

<tr>
<td align="right">
<apex:commandButton image="{!$Resource.redLight}" action="{!back}"></apex:commandButton>
<apex:commandButton image="{!$Resource.greenLight}" action="{!next}"></apex:commandButton>

<apex:commandButton image="{!$Resource.mail_image}" action="{!sendEmail}" value="Send Mail">
</apex:commandButton>
</td>

</tr>
</table>
</center>
</div>
</apex:tab>

<apex:tab label="Connections" style="background-color:white;">
<div style="background-color:white;">

</div>
</apex:tab>
<apex:tab label="History" style="background-color:white;">
<div style="background-color:white;">
</div>
</apex:tab>
</apex:tabPanel>
</div>
<apex:outputPanel id="detail">
<apex:outputText value="{!$CurrentPage.parameters.email}" > </apex:outputText>
</apex:outputPanel>
</apex:form>
</apex:page>

 
Thanks,
Joseph