Webリソースの1つでJavaScriptメソッドを呼び出すリボンボタンが必要です。
の中に CommandDefinition
Ribbondiff XMLのうち、Subgrid内の選択されたレコードのすべてのIDを含むJSメソッドにパラメーターを送信する必要があります。
<CommandDefinitions>
<CommandDefinition Id="xyz.Button.SendEmail.command">
<EnableRules>
</EnableRules>
<DisplayRules>
</DisplayRules>
<Actions>
<JavaScriptFunction Library="$webresource:Test.Js" FunctionName="SendEmail">
<CrmParameter Value="SelectedControlAllItemIds" />
</JavaScriptFunction>
</Actions>
</CommandDefinition>
そして、JSメソッドは以下のようなものであり、すべてのIDを解析してロジックを処理する必要があります
function SendEmail(selectedIds) {
if (selectedIds != null && selectedIds != “”) {
var strIds = selectedIds.toString();
var arrIds = strIds.split(“, ”);
for (var indxIds = 0; indxIds < arrIds.length; indxIds++) {
//The logic that you want to process on each record will come here.
}
} else {
alert(“No records selected !! !”);
}
}