Content-Length: 296394 | pFad | http://github.com/simple-salesforce/simple-salesforce/pull/731/files

F7 add ability to query listview by h0h0h0 · Pull Request #731 · simple-salesforce/simple-salesforce · GitHub
Skip to content

add ability to query listview #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: release/v1.12.7
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions simple_salesforce/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,48 @@ def apexecute(

return response_content

def listview_results(
self,
sf_object: str,
listview_id: str,
limit: Optional[int] = None,
offset: Optional[int] = None,
**kwargs: Any
) -> Any:
"""Return results from the given listview ID and associated Salesforce object.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_listviewresults.htm
Arguments:
* sf_object -- The salesforce object that the listview id is associated with.
* listview_id -- the listview id to get results from
* limit -- total number of records to return in one go
* offset -- starting record to return data for
* kwargs -- Additional kwargs to pass to `requests.request`
"""
# If data is None, we should send an empty body, not "null", which is
# None in json.
params = []
if limit is not None:
params.append(f'limit={limit}')

if offset is not None:
params.append(f'offset={offset}')
param_string = '?' + '&'.join(params) if params else ''
url = self.base_url + f"/sobjects/{sf_object}/listviews/{listview_id}/results{param_string}"

result = self._call_salesforce(
'GET',
url,
name="listview_results",
**kwargs
)
try:
response_content = self.parse_result_to_json(result)
# pylint: disable=broad-except
except Exception:
response_content = result.text

return response_content

def _call_salesforce(
self,
method: str,
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/simple-salesforce/simple-salesforce/pull/731/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy