Sometimes, external system wants to get the latest data from Salesforce to run the business logic in their system. In those cases, external system can do a simple query Salesforce objects with the help of Salesforce Standard APIs. There is no code required from a Salesforce developer
Lets understand this concept with an example.
Consider Workbench as a external system. To query salesforce objects in workbench we need to follow the below pattern:
/services/data/v20.0/query?q=SELECT+Id+,+Name+FROM+USER
where every element is concatenated by + operator
After the query is added click on Execute and once the response comes then click on Show Raw Data. It will open up the blue screen on the right.
- totalsize attribute is the number of records returned.
- At a time workbench can display 2000 records under raw response.
- If the number of records returned are more than 2000 then NextRecordsUrl will be used to get next set of 2000 records.
- Done Attribute under raw response tells whether we have reached the last page or not.
- If done = false then we need to NextRecordUrl to get next records.
- If done = false, that mean there are no more records after this.
No comments:
Post a Comment