From d282a733805fa53bc71065cef3a7743cbe7bd77e Mon Sep 17 00:00:00 2001 From: Ashutosh619-sudo Date: Fri, 27 Sep 2024 13:56:46 +0530 Subject: [PATCH] feat: Count API will get only active counts --- netsuitesdk/api/base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/netsuitesdk/api/base.py b/netsuitesdk/api/base.py index 368bff0..5d70c6a 100644 --- a/netsuitesdk/api/base.py +++ b/netsuitesdk/api/base.py @@ -40,7 +40,13 @@ def get_all(self): return all_records def count(self): - ps = PaginatedSearch(client=self.ns_client, type_name=self.type_name, pageSize=10, perform_search=True) + record_type_search_field = self.ns_client.SearchBooleanField(searchValue=False) + basic_search = self.ns_client.basic_search_factory( + type_name=self.type_name, + isInactive=record_type_search_field, + ) + + ps = PaginatedSearch(client=self.ns_client, type_name=self.type_name, pageSize=10, perform_search=True,basic_search=basic_search) return ps.total_records def get_all_generator(self, page_size=20):