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
dai tran 6dai tran 6 

How can add visualforce page to Dashboards?

My controller:
public class LensPageController {
 public string username{get;set;}
    public List<Order> MyOrder {get;set;}
    public string err{get;set;}
    private final Order oderitem;
    public LensPageController(ApexPages.StandardController stdController)
        this.oderitem = (Order)stdController.getRecord();
             Cookie ck=ApexPages.currentPage().getCookies().get('username');
             if(ck !=null)

My visualforce page:
<apex:page  standardController="Order" extensions="LensPageController" showHeader="false" sidebar="false" >

But still can't select in page layout:
No Visualforce pages available
Hitendar Singh 9Hitendar Singh 9

Visualforce pages that use the Standard Controller can’t be used in dashboards. To be included in a dashboard, a Visualforce page must have either no controller, use a custom controller, or reference a page bound to the StandardSetController Class. If a Visualforce page does not meet these requirements, it does not appear as an option in the dashboard component Visualforce Page drop-down list.

You page uses the standard controller and does not use recordSetVar. This is the reason why it is not available to select as dashboard component.

Hope this answers.