リストビューで表示されたレコードを一括してコピー例を紹介します。
コントローラ
public with sharing class CustomAccountSetController {
public List<Account> selectedAccs {get;set;}
public CustomAccountSetController(ApexPages.StandardSetController controller) {
List<Account> accs = controller.getSelected();
this.selectedAccs = [SELECT Id, Name FROM Account WHERE Id IN :(new Map<Id, Account>(accs)).keySet()];
}
public void execute() {
system.debug('execute');
}
}
Visualforceページ
<apex:page standardController="Account" recordSetvar="accs" extensions="CustomAccountSetController">
<apex:form>
<apex:pageBlock title="選択済み取引先" >
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!execute}" value="実行" oncomplete="history.back();" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selectedAccs}" var="acc">
<apex:column value="{!acc.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
カスタムボタン

取引先リストビュー
