You need to sign in to do that
Don't have an account?
VSK98
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
And also i have created the lightning component
Lightning Component:
the values are passing but getting the error "This page isn't available in Salesforce Lightning Experience or mobile app."
Regards,
VSK98
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); pgReturnPage.setRedirect(true); 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> </aura:iteration> </lightning:card> </aura:component>
({ onPageReferenceChange: function(cmp, evt, helper) { alert('alert'); var myPageRef = cmp.get("v.pageReference"); var accs = myPageRef.state.c__listofAccounts; alert(accs.length); console.log('listofAccounts',JSON.stringify(accs)); // 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."
Regards,
VSK98
Steps - http://www.infallibletechie.com/2018/06/new-button-is-not-appearing-in.html
I have already enabled the lightning experience checkbox but no luck.............
Regards,
VSK98
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