Skip to content

Commit

Permalink
searchMoreWithId functionality to SOAP interface (#71)
Browse files Browse the repository at this point in the history
* Update index.md

add REST API example in Programmatic use section

* Update SOAP client.py to include searchMoreWithId

Added searchMoreWithId function in SOAP interface to be able to paginate results when more than 1000 returns. See the following docs for more information. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N3523074.html#searchMoreWithId

* Update SOAP client.py to include searchMoreWithId

Added searchMoreWithId function in SOAP interface to be able to paginate results when more than 1000 returns. See the following docs for more information. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N3523074.html#searchMoreWithId

* formatted code with Black

* removed duplicate function definition

---------

Co-authored-by: Cameron Lofy <cameronlofy@gmail.com>
  • Loading branch information
vlouvet and CameronLofy authored Jan 11, 2024
1 parent f903be7 commit 7a80b01
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions netsuite/soap_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,18 @@ async def search(
"search", searchRecord=record, additionalHeaders=additionalHeaders
)

@WebServiceCall(
"body.searchResult",
extract=lambda resp: resp["recordList"]["record"],
)
async def searchMoreWithId(
self, searchId: str, pageIndex: int
) -> List[zeep.xsd.CompoundValue]:
"""Search records with pagination"""
return await self.request(
"searchMoreWithId", searchId=searchId, pageIndex=pageIndex
)

@WebServiceCall(
"body.writeResponseList",
extract=lambda resp: [record["baseRef"] for record in resp],
Expand Down

0 comments on commit 7a80b01

Please sign in to comment.