function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rob Waibel JrRob Waibel Jr 

Using custom query in soap-API

I have the following query:
SELECT AccountId,Account.JDE_Number__c, SUM(Rollover_Points__c) FROM Contact
WHERE No_Longer_w_Account__c = false AND Rollover_Points__c > 0 Group By AccountID,Account.JDE_Number__c
I am using soap to connect to Sales force, I want to fill a QueryResult with teh results of this qury and place it in a .NET datatable.

Solution?
Best Answer chosen by Rob Waibel Jr
Rob Waibel JrRob Waibel Jr
Figured it out!
I used the AggregateResult method them iterated thru each record (like an xml)
 Dim Record As New sForce.AggregateResult

            If qr.records.Count > 0 Then
                For Each Record In qr.records
                    nRow = DT.NewRow
                    nRow("AccountID") = Record.Any(0).InnerText.Replace(Chr(34), "")
                    nRow("TotalRollOver") = Record.Any(2).InnerText.Replace(Chr(34), "")
                    nRow("AN8") = Record.Any(1).InnerText.Replace(Chr(34), "")
                    DT.Rows.Add(nRow)
                Next
            End If

Works like a charm!