question

jax_music_supply avatar image
0 Likes"
jax_music_supply asked ·

Set pagination page number in GetmyEbaySelling request

No problem getting data - first page of 200 items is returned. However, all attempts to set the page number to a different page (or even just to specify page 1 results in an object error: Dim apicall As GetMyeBaySellingCall = New GetMyeBaySellingCall(Context) apicall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll) 'The following lines throw object not set errors used together or separately. apicall.ActiveList.Pagination.PageNumberSpecified = True apicall.ActiveList.Pagination.PageNumber = 1 'execute api apicall.Execute() Thanks in advance for any insight.
.NETgetmyebaysellingcallvb.netpagination
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
jax_music_supply avatar image
0 Likes"
jax_music_supply answered ·
Kind of amazing how inactive this forum is. A lot of people asking questions but very answers. I asked the above questions and this seemed like an easy question. Luckily I was able to translate some java code on another forum to solve the problem. The code to do this was not intuitive at all. Getting and setting properties requires for this SDK creating a separate object, set the properties, and then having the API inherent that object. Seems like a lot of overhead. In any case, the code is something like this: Dim pt As New PaginationType Dim apicall As GetMyeBaySellingCall = New GetMyeBaySellingCall(Context) Dim itemlist As ItemListCustomizationType = New ItemListCustomizationType itemlist.Include = True pt.EntriesPerPage = 200 pt.PageNumber = 2 itemlist.Pagination = pt apicall.ActiveList = itemlist With apicall .Execute() End With Dim sellerlist As ItemTypeCollection = apicall.ActiveListReturn.ItemArray 'apicall.GetMyeBaySelling() ' iPageNumber = apicall.ActiveList.Pagination.PageNumber iTotalPages = apicall.ActiveListReturn.PaginationResult.TotalNumberOfPages iPageNumber = 2 'Set starting page number for remaining pages set at 1 because it gets incremented immediately 'Dim item As ItemType Do Until iPageNumber = iTotalPages 'Only do this for the remaining of pages For Each item In sellerlist Dim listparams(9) As String listparams(0) = item.ItemID listparams(1) = item.SKU listparams(2) = item.Quantity.ToString listparams(3) = item.QuantityAvailable.ToString ' listparams(4) = item.Sellingstatus.CurrentPrice.ToString sReturnString = sReturnString + " ItemID: " & listparams(0) & " SKU: " & listparams(1) & " Quantity: " & listparams(2) & " Quantity Avail: " & listparams(3) & " Current Price: " & listparams(4) & "
" Next item iPageNumber = iPageNumber + 1 'increment page And so on... Should get you past the hump.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.