+ Start a Discussion

This page isn't available in Salesforce Lightning Experience or mobile app.G

Hello All,

Getting the error when the user clicks on the list view button on Account....

I need to pass  selected records from javascript button to lightning component. So i have created one List View Button.

And also i have created the VF Page / Apex class...below is snippet code
<apex:page standardController="Account" recordSetVar="accs" extensions="VFC_ProcessAccRecords" action="{!redirectToLC}"  lightningStylesheets="true"/>
public class VFC_ProcessAccRecords {
      public List<Account> selAccLst;
      public String accIds;

      // Constructor
      public VFC_ProcessAccRecords(ApexPages.StandardSetController cntlr){
           selAccLst = cntlr.getSelected(); //get selected records from account list view
           accIds = '';  
           for(Account acc : selAccLst){
               accIds += acc.Id + ','; //build list of ids string concatenated with comma                         
           accIds = accIds.removeEnd(','); 

      public PageReference redirectToLC(){
            String returnUrl = '/lightning/cmp/c__Custom_List_View_Process?c__listofAccounts='+accIds;
            PageReference pgReturnPage = new PageReference(returnUrl);
            return pgReturnPage;


And also i have created the lightning component

Lightning Component:
<aura:component implements="lightning:isUrlAddressable" access="global">
    <aura:attribute name="listofAccounts" type="List" />
    <aura:handler name="init" value="{!this}" action="{!c.onPageReferenceChange}"/>
    <lightning:card title="Account List">
        <aura:iteration items="{!v.listofAccounts}" var="item">
            <p class="slds-p-horizontal_small"> Account Id {!item} </p>
    onPageReferenceChange: function(cmp, evt, helper) {
        var myPageRef = cmp.get("v.pageReference");
        var accs = myPageRef.state.c__listofAccounts;
      //  cmp.set("v.listofAccounts",accs);
        //split the account ids by comma and continue logic

the values are passing but getting the error "This page isn't available in Salesforce Lightning Experience or mobile app." 

Edit the VF page and make sure "Available for Lightning Experience, Lightning Communities, and the mobile app" is enabled.
Steps - http://www.infallibletechie.com/2018/06/new-button-is-not-appearing-in.html
Hi MagulanDuraipandian,

I have already enabled the lightning experience checkbox but no luck.............

Try this way
1. Use Lightning Component and avoid VF.
2. Call the apex method using init event from Lightning Component.

There is no standard way of navigating from vf to Lightning - https://developer.salesforce.com/forums/?id=9060G000000I22IQAS