6

I would like to create a simple visualforce tab to show "all quotes". Here is the code:

<apex:page standardController="Quote">
  <apex:enhancedList type="Quote" height="700" rowsPerPage="50" id="AllQuotes">
  </apex:enhancedList>
</apex:page>

I am getting an insufficient privileges error. The profile can see the VF page and the view, I think it is an enhanced list syntax error but not sure how to resolve.

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.

1
  • 1
    Does the User's Profile have Read Access to the Quote Object and is the list view All Quotes shared with the User ? Jun 6, 2013 at 17:49

4 Answers 4

6

I feel this has to do with the way salesforce has set up quote object, after looking around looks like there is no tab for Quotes making it pretty obvious building a list views/enhancedview is going to impossible.

I may be wrong, but would happy if someone here can post a solution!!!

Idea: https://success.salesforce.com/ideaView?id=08730000000I2Tj

Update: paginated : (CTRL +C , CTRL +V : http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/) and modified the code for matching this req. All that I can help you with is this : (Make it fancy with a bit more pagination incase you need to handle more records) enter image description here

<apex:page controller="PagingController">
 <apex:form >
  <apex:pageMessages /> 
   <apex:pageBlock title="All Quotes modified with in last year">
    <apex:pageBlockSection title="Quote Results -  Page #{!pageNumber}" columns="1">
     <apex:pageBlockTable value="{!quotes}" var="c">
        <apex:column value="{!c.Id}" headerValue="Quote ID "/>
        <apex:column value="{!c.Name}"  headerValue="Quote Name"/>
        <apex:column headerValue="Name"> <apex:outputlink value="/{!c.Id}" target="_blank">{!c.name}</apex:outputlink></apex:column>   
      </apex:pageBlockTable> 
    </apex:pageBlockSection>
  </apex:pageBlock> 
  <apex:panelGrid columns="4">
   <apex:commandLink action="{!first}">First</apex:commandlink>
   <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandlink>
   <apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandlink>
   <apex:commandLink action="{!last}">Last</apex:commandlink>
  </apex:panelGrid> 
 </apex:form>
</apex:page>

controller:

public with sharing class PagingController {
  List<quote> quotes{get;set;}

  // instantiate the StandardSetController from a query locator
  public ApexPages.StandardSetController con {
    get {
        if(con == null) {
            con = new ApexPages.StandardSetController(Database.getQueryLocator([Select Id, Name FROM quote where lastmodifieddate >=: system.today()-365]));
            // sets the number of records in each page set
            con.setPageSize(5);
        }
        return con;
    }
    set;
   }

 // returns a list of wrapper objects for the sObjects in the current page set
 public List<quote> getQuotes() {
    quotes= [Select Id, Name FROM quote where lastmodifieddate >=: system.today()-365];

    return quotes;
 }

 // indicates whether there are more records after the current page set.
 public Boolean hasNext {
    get {
        return con.getHasNext();
    }
    set;
 }

 // indicates whether there are more records before the current page set.
 public Boolean hasPrevious {
    get {
        return con.getHasPrevious();
    }
    set;
 }

 // returns the page number of the current page set
 public Integer pageNumber {
    get {
        return con.getPageNumber();
    }
    set;
 }

 // returns the first page of records
 public void first() {
    con.first();
 }

 // returns the last page of records
 public void last() {
    con.last();
 }

 // returns the previous page of records
 public void previous() {
    con.previous();
 }

 // returns the next page of records
 public void next() {
    con.next();
 }

 // returns the PageReference of the original page, if known, or the home page.
 public void cancel() {
    con.cancel();
 } 
}
3

Same happens when you force going to Quote tab: https://instance.salesforce.com/0Q0

And for extra fun - try making a different listview:

enter image description here

I wonder whether it's a "real" limitation / error or maybe my Dev Edition doesn't have some feature enabled (Customizable Forecasts and whatnot). So looks like you have to hand-craft everything from scratch, show rao's answer some love!

1
  • Yea I think @rao called it earlier. This object is definitely not setup to function like the other standard objects.
    – drakored
    Jun 6, 2013 at 19:16
0

I've bumped into this with other objects. You need to use the 15 digit ID for the view. When you go to the view, grab the Id from the URL. That should work.

0

Try this:

    <apex:page standardController="Quote" recordSetVar="quotes">
    <apex:pageBlock title="All Quotes">
        <apex:pageBlockSection title="Quote Results" columns="1">
        <apex:pageBlockTable value="{!quotes}" var="c">
            <apex:column value="{!c.Id}" headerValue="Quote ID "/>
            <apex:column value="{!c.Name}"  headerValue="Quote Name"/>
            <apex:column headerValue="Name"> <apex:outputlink value="/{!c.Id}" target="_blank">{!c.name}</apex:outputlink></apex:column>   
          </apex:pageBlockTable> 
        </apex:pageBlockSection>
      </apex:pageBlock> 
    </apex:page>
1
  • Welcome to SE. while putting the code always add some detail about the code such as what it is doing and how it is solving the problem.
    – Himanshu
    May 10, 2016 at 9:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .