Pagination Example #181
Unanswered
bfarrgaynor
asked this question in
Q&A
Replies: 1 comment
-
I could probably figure something out but really it is kinda a pain. I made to help and skimming some of your code it looks like it would work for you. https://packagist.org/packages/neclimdul/netsuite-search-iterator |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Are you able to provide a working example of how pagination works?
I seem to be struggling to get results on 'page 2' and beyond in any of my queries, either on saved searches like my example below, or in cases where I'm looking at a specific location that I know has lots of results.
`<?php
namespace BBEC\Console\Commands;
use Illuminate\Console\Command;
use NetSuite\NetSuiteService;
use NetSuite\Classes\InventoryNumberSearchAdvanced;
use NetSuite\Classes\SearchRequest;
use NetSuite\Classes\SearchPreferences;
use NetSuite\Classes\SearchMoreWithIdRequest;
class GetInventoryNumberSavedSearch extends Command
{
protected $signature = 'netsuite:get-inventory-numbers';
protected $description = 'Retrieve results from a NetSuite saved search on Inventory Numbers';
}`
Result:
` php artisan netsuite:get-inventory-numbers
Running saved search 'customsearch1083' (internal ID 1083) on Inventory Numbers...
Fetching page 2 of 128...
In NetSuiteClient.php line 197:
No such operation 'searchMoreWithId' `
Here is another example:
`<?php
namespace BBEC\Console\Commands;
use Illuminate\Console\Command;
use NetSuite\NetSuiteService;
use NetSuite\Classes\ItemSearchBasic; // Use ItemSearchBasic instead of InventoryItemSearchBasic
use NetSuite\Classes\SearchRequest;
use NetSuite\Classes\SearchPreferences;
use NetSuite\Classes\SearchMoreWithIdRequest;
class SyncNetSuiteProducts extends Command
{
protected $signature = 'netsuite:sync-products';
protected $description = 'Sync products from NetSuite and display their data';
}`
And the results:
`...
ID: 6464 | Name: Aquawood - Wharf's Pier 34 - 2530-665 | Qty at Location 18: N/A
Item 6465 has no locationsList.
ID: 6465 | Name: Big Ben Plus - Nottingham Oak 09 | Qty at Location 18: N/A
Item 6466 has no locationsList.
ID: 6466 | Name: Big Ben Plus - London Fog 11 | Qty at Location 18: N/A
Item 6467 has no locationsList.
ID: 6467 | Name: Big Ben Plus - Hackney 1231 | Qty at Location 18: N/A
Item 6468 has no locationsList.
ID: 6468 | Name: Big Ben Plus - Bristol Brown 13 | Qty at Location 18: N/A
Item 6469 has no locationsList.
ID: 6469 | Name: Big Ben Plus - Camber Sands 15 | Qty at Location 18: N/A
Item 6470 has no locationsList.
ID: 6470 | Name: Big Ben Plus - Soho Chic 16 | Qty at Location 18: N/A
Item 6471 has no locationsList.
ID: 6471 | Name: Big Ben Plus - Sherwood 58 | Qty at Location 18: N/A
Item 6472 has no locationsList.
ID: 6472 | Name: Camden Lock 12mm Laminate - Newcastle Ale 8389-1 | Qty at Location 18: N/A
Item 6473 has no locationsList.
ID: 6473 | Name: Camden Lock 12mm Laminate - Farynor Smoke 8389-2 | Qty at Location 18: N/A
Item 6474 has no locationsList.
ID: 6474 | Name: Camden Lock 12mm Laminate - Jasmine 8367-9 | Qty at Location 18: N/A
Item 6475 has no locationsList.
ID: 6475 | Name: Camden Lock 12mm Laminate - Regent 1754-1 | Qty at Location 18: N/A
Item 6476 has no locationsList.
ID: 6476 | Name: Camden Lock 12mm Laminate - Dorset 1014-7 | Qty at Location 18: N/A
Item 6477 has no locationsList.
ID: 6477 | Name: Camden Lock 12mm Laminate - Somerset 1008-7 | Qty at Location 18: N/A
Item 6478 has no locationsList.
ID: 6478 | Name: Camden Lock 12mm Laminate - Stratford 1014-5-6 | Qty at Location 18: N/A
In NetSuiteClient.php line 197:
No such operation 'searchMoreWithId'
`
Beta Was this translation helpful? Give feedback.
All reactions