Skip to content

Instantly share code, notes, and snippets.

@sjurgis
Created December 17, 2022 19:15
Show Gist options
  • Save sjurgis/d02eda4d64ae5ad93d254e734a1f1f3b to your computer and use it in GitHub Desktop.
Save sjurgis/d02eda4d64ae5ad93d254e734a1f1f3b to your computer and use it in GitHub Desktop.
public with sharing class ModalList {
ApexPages.StandardSetController setCon;
public PageReference init() {
List<Id> ids = new List<Id>();
for (SObject i : this.setCon.getSelected()) {
ids.add((String)i.get('Id'));
}
return new PageReference(
String.format('/lightning/cmp/c__ModalWrapper?c__ids={0}&c__returnUrl={1}', new String[]{
String.join(ids, ','),
this.setCon.cancel().getUrl()
})
);
}
public ModalList(ApexPages.StandardSetController controller) {
this.setCon = controller;
}
}
<apex:page
showHeader="false"
standardStylesheets="false"
title="Redirecting"
standardController="Lead"
recordSetVar="leads"
extensions="ModalList"
cache="false"
action="{!init}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment