You need to sign in to do that
Don't have an account?
THuston
AggregateResult class not in Partner.wsdl
Salesforce.com Partner Web Services API Version 18.0
Generated on 2010-04-07 13:35:56 +0000.
There is no AggregateResult in the Partner.wsdl I just generated.
I built it anyway and can run aggregate SOQL into a QueryResult, however the Field names are all "Double".
I'm hoping the AggregateResult class exists and has more info about the source function (MAX, MIN, AVG, ect) and Field (Ammount, ect) it was used on.
Any idea how to get it? or how to get the source Field info?
There's no AggregateResult class in the partner.wsdl just like there's no Account or Contact class.
aggregate results will be returned as a regular partner SObject with the type element set to AggregateResult, and the any collection returning the columns you queried for.
All Answers
There's no AggregateResult class in the partner.wsdl just like there's no Account or Contact class.
aggregate results will be returned as a regular partner SObject with the type element set to AggregateResult, and the any collection returning the columns you queried for.
So when I make this query:
QueryResult qr = binding.query("SELECT Name, MAX(Amount), MIN(Amount) FROM Opportunity GROUP BY Name");
When I traverse the objects, I get:
Name, expr0, expr1
with MessageElement Types
null, Double, Double
How can I detect that expr0 is a MAX function on Amount??
Here is the PartnerSamples example Java code I use to look at the QueryResult:
Ouput looks like this
null
Burlington Textiles Weaving Plant Generator
{http://www.w3.org/2001/XMLSchema}double
Double
235000.0
{http://www.w3.org/2001/XMLSchema}double
Double
235000.0
You can't tell what sort of expr was used in the query from the results.
I guess that saves me time. I simply cannot upgrade away from v17 and the users can suck it.
What's worse is if you use an alias name that matches a field name in that object. There's no way to detect the difference in the response xml between a value for a field of that object or an aggregate function value whose alias is that name without basically building a SOQL parser and aligning the Select list with the xml response.
What is needed is an attribute in the output that indicates this field result is the result of an aggregate function. Without aliases, you could look for exprXXX. With aliases, you better get started on your SOQL parser :).
Just my 2 cents.
Bill