AdHocQueryProcessReply -- Values shifted when Start and Limit included

When making an AdHocQueryProcessRequest to the appfxwebservice that includes a Start and Limit like so:

<AdHocQueryProcessRequest xmlns="Blackbaud.AppFx.WebService.API.1" AdHocQueryID="8d6b6163-faa3-48a4-8cc3-da4c716d851e" Start="0" Limit="20">


In the reply, the first output row value is dropped -- it appears that a row number has been inserted at the end (after the QUERYRECID, which is typically the last value returned). I say it's a row number because that value increments for each of the output rows.


Since the first output row value is dropped, the output values no longer align with the select fields -- for this particular query, the first select field is "Revenue Lookup ID" , however, the output value is now "Date".

<Rows>

<r>

<Values>

<v>2021-03-21T00:00:00</v>

<v>154.5000</v>

<v>California</v>

<v>95070-5241</v>

<v>8-54936864</v>

<v>Payment</v>

<v>Donation</v>

<v>Posted</v>

<v>False</v>

<v>11c12a52-0fb9-4f15-9176-6cda26e6b26b</v>

<v>1</v>

</Values>

</r>

<r>

<Values>

<v>2021-03-21T00:00:00</v>

<v>515.0000</v>

<v>California</v>

<v>95035-9068</v>

<v>8-40205916</v>

<v>Payment</v>

<v>Donation</v>

<v>Posted</v>

<v>False</v>

<v>e48904b9-b06a-44c9-a8fd-1ee0ec63d4c6</v>

<v>2</v>

</Values>

</r>

<Rows>



If the Start and Limit are not included, the output rows line up with the select fields - notice the Revenue Lookup ID is now the first Value and the "row number" at the end is no longer included

<Values>

<v>rev-44466076</v>

<v>2021-03-21T00:00:00</v>

<v>154.5000</v>

<v>California</v>

<v>95070-5241</v>

<v>8-54936864</v>

<v>Payment</v>

<v>Donation</v>

<v>Posted</v>

<v>False</v>

<v>11c12a52-0fb9-4f15-9176-6cda26e6b26b</v>

</Values>



Is there an alternative way to use paging? This seems to be an issue in hosted environments only, as I cannot reproduce it with a local instance of BBCRM.

Comments

  • Hey Ben,

    I don't think you need an alternate way of paging because part of the reply should be the <Fields> node. This contains the fields that are being returned and their order should correspond with the order of the <Values> node. If you modify your code to look at the values node and use the corresponding index value to pull the values you want order shouldn't really matter.

Categories