Requesting Leads via API with "Accept Status" field results in incorrect number of records returned?

Hello,

I'm currently using the rest API (V11_1) and Sugar 8.2 to try and pull Leads records from my Sugar instance. In most cases this works correctly, and all 1,754 of the leads in the instance are returned. However, when I make a request that specifically requests the fields "accept_status_meetings" and "accept_status_calls" in it, only 1001 records are returned. What's more is that this occurs even though I'm setting a "max_num" parameter of 1000. If I request either one of these fields without the other, 1,753 records will be returned. Additionally, if I pull all fields (by not specifying which fields to pull), all records will be returned.

Can anyone provide any insight as to why these discrepancies are occurring? Performing the same request with the V4_1 API yields the correct number of records.

Here is the request I'm using, as tested with Postman: 

{{url}}/rest/v11/Leads?fields=id%2Caccept_status_meetings%2Clast_name%2Cemail1%2Caccept_status_calls&max_num=1000&offset=0&deleted=0&order_by=id

  • So I don't have a direct answer (yet) but I do not think that the accept_status_meeting and accept_status_calls have meaning in context of a single Lead record. These fields are used to represent the accept_status for a Lead record for a given Meeting or Call. The data is actually stored on the join table.

    Basically, Leads are related to Meetings when they are invited to these meetings. Whether or not the Lead has accepted the invitation is an attribute of that relationship.

    This may cause some strange subquery behavior that breaks the query limit when retrieving via the Filter API.

    If possible, I would not synchronize the accept_status_* fields in this way.

    You'd be better off looking that up when needed.

    For example,

    GET /rest/v11_1/Meetings/{meeting_id}/link/leads/filter

    http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_8.2/Integration/Web_Services/REST_API/En… 

    App Ecosystem @ SugarCRM

  • Thanks for the update, Matt. I'll look at avoiding pulling those fields by themselves. I notice that I don't see the same error when using the V4_1 endpoint to perform the pull, do the different endpoints use different tables for their queries? 

  • They'd use the exact same DB tables but the way the queries are constructed will be very different. The REST API will use some of the newer internal frameworks that we've built over the years.

    App Ecosystem @ SugarCRM