Skip to content

Commit

Permalink
Update SOAP client.py to include searchMoreWithId
Browse files Browse the repository at this point in the history
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
  • Loading branch information
CameronLofy authored and vlouvet committed Dec 25, 2023
1 parent fa18d5f commit f61adba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions netsuite/soap_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,16 @@ async def searchMoreWithId(
"""Search records with pagination"""
return await self.request("searchMoreWithId", searchId=searchId, pageIndex=pageIndex)

@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 f61adba

Please sign in to comment.