Recently I worked on a requirement where I had to return List after adding results from 2 different queries in specific format because the managed class method overriding only returns list of objects.
List<AggregateResult> R1=[SELECT Count(name) C1 from Sobject1__c];
List<AggregateResult> R2=[SELECT Count(name) C2 from Sobject2__c];
I want to return results as below
(AggregateResult:{C1=5},{C2=6})
If I merge both then result returned is (AggregateResult:{C1=5},AggregateResult:{C2=6}) and second part is ignored while tool processes response.
At the moment I am achieving this by writing 2 separate classes and processing separately in my configurator tool. I am looking for options if this can be done.
PS: I can't change it to map or something else as this overridden method does only returns list of object which I'm using in a managed tool in UI.
Let me know if more details are needed.
List<AggregateResult>
to me. Can you go into more detail about what the difference is, and what your other "tool" is? I'm particularly interested in why your "tool" is ignoring part of your input. – Derek F Apr 25 '18 at 12:38