I have an aggregate result to process OpportunityLineItems by custom field PackageId - using min, max, avg etc for most fields works fine.
However, for a text field I want to collect all the values into one string, probably csv, and then push into my output object.
Is this possible? thanks
I am trying to collect product_subtype__c from OpportunityLineItems that share a packageid__c field - my try to create a map:
Map<string,string> SubTypeMap = new map<string,string>();
List <opportunityLineItem> Records = [select PackageAdId__c, product_subtype__c
from OpportunityLineItem
where Opportunityid =: opp.id];
for(opportunityLineItem record:records){
SubtypeMap.put(record.PackageAdId__c,
getValuesFromRecords(record.records, opportunityLineItem.Product_SubType__c));
}
Produces this error:
Variable does not exist: records
Concatenate
andConcatenate Unique
aggregate functions.