How to implement paging

Nov 4, 2008 at 8:17 PM
The lastOrderNumber and maxCount are used to implement paging. Please see the comments for ShippingAgentBase.GetNewOrders,

If the order number of the last order in the list you return is equal to the lastOrderNumber parameter, Shipper will complain that the data is not being paged.

Here’s an example sequence of events:

  1. You click on Get New Orders
  2. Shipper calls GetNewOrders(“”, 20)
  3. Shipping Agent searches for new orders and returns the first 20 . The last order has order number B123.
  4. Shipper calls GetNewOrders(“B123”, 20)
  5. Shipping Agent searches for new orders and returns the 20 orders that are “after” B123 (that’s the paging part). The last order has order number B201.
  6. Shipper calls GetNewOrders(“B201”, 20)
  7. Shipping Agent searches for new orders and returns the 13 orders that are “after” B201. The last order has order number B251.
  8. Shipper stops calling GetNewOrders because less than 20 orders were returned.

The next time you click on Get New Orders, Shipper will call GetNewOrders(“B251”, 20).
Dec 4, 2008 at 6:25 PM
Paging is handled differently in 3.2. See source code notes.