在对应的页面新建对应的Button或者Action
使用Visualforce 进行获取
<apex:page standardController="Account" recordSetVar="accounts"
extensions="CustomerVisitPlanListViewController" action="{!redirect}">
<script>
window.onload = setupPage;
function setupPage() {
var records = {!selectedAccounts};
console.log(records);
if (records.length === 0) {
sforce.one.showToast({
'title': 'Alert!',
'message': 'Please select at least one account.',
'type': 'warning',
});
window.history.go(-1)
}
}
</script>
</apex:page>
Apex
public class CustomerVisitPlanListViewController{
public List<Account> selectedAccounts {