Skip to content

Commit

Permalink
Fix for issue SFDO-Community#128 Concatenate Distinct Multi-Select Pi…
Browse files Browse the repository at this point in the history
…cklists
  • Loading branch information
dhoechst committed Mar 5, 2015
1 parent 765c375 commit 5f8cdde
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions rolluptool/src/classes/LREngine.cls
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,15 @@ public class LREngine {
rsf.operation == RollupOperation.Concatenate_Distinct) {
Concatenator concatenator =
new Concatenator(rsf.operation == RollupOperation.Concatenate_Distinct, rsf.concatenateDelimiter);
for(SObject childDetailRecord : childDetailRecords)
concatenator.add(String.valueOf(childDetailRecord.get(rsf.detail.getName())));
for(SObject childDetailRecord : childDetailRecords) {
if (rsf.detail.getType() == Schema.DisplayType.MultiPicklist) {
for (String mspValue : String.valueOf(childDetailRecord.get(rsf.detail.getName())).split(';')) {
concatenator.add(mspValue);
}
} else {
concatenator.add(String.valueOf(childDetailRecord.get(rsf.detail.getName())));
}
}
String concatenatedValues = concatenator.toString();
concatenatedValues = concatenatedValues.abbreviate(rsf.master.getLength());
masterRecordsMap.get(masterId).put(rsf.master.getName(), concatenatedValues);
Expand Down

0 comments on commit 5f8cdde

Please sign in to comment.