dotConnect for Zoho CRM - Using Include() on IQueryable tries to download every enitity in DB

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
bob_vidabox
Posts: 9
Joined: Fri 13 Dec 2019 00:31

dotConnect for Zoho CRM - Using Include() on IQueryable tries to download every enitity in DB

Post by bob_vidabox » Wed 18 Dec 2019 21:24

Building off another forum discussion found here I have tried adding an include to return the related Contacts for an Account. However, instead of using a search it attempts to download every contact in the database. It should be searching based on Account_Name or using the Related Lists API as shown below.

GET /crm/v2/Contacts/search?criteria=(Account_Name:equals:###)&per_page=200&page=1
or
GET /crm/v2/Accounts/###/Contacts

where ### is the Id from the matching account query.


Code: Select all

using (var context = GetZohoCrmContext())
{
    var account = await context.Accounts.Include(a=>a.Contacts).SingleAsync(a => a.Website == "http://xyz.com");
    return account;
}
Requests
GET /crm/v2/settings/modules
GET /crm/v2/settings/related_lists?module=Leads
GET /crm/v2/settings/related_lists?module=Accounts
GET /crm/v2/settings/related_lists?module=Activities
GET /crm/v2/settings/related_lists?module=Calls
GET /crm/v2/settings/related_lists?module=Cases
GET /crm/v2/settings/related_lists?module=Contacts
GET /crm/v2/settings/related_lists?module=Events
GET /crm/v2/settings/related_lists?module=Invoices
GET /crm/v2/settings/related_lists?module=Products
GET /crm/v2/settings/related_lists?module=Sales_Orders
GET /crm/v2/settings/related_lists?module=Tasks
GET /crm/v2/settings/fields?module=Accounts
GET /crm/v2/settings/related_lists?module=Accounts
GET /crm/v2/settings/fields?module=Contacts
GET /crm/v2/settings/related_lists?module=Contacts
GET /crm/v2/Accounts/search?criteria=(Website:equals:http%3A%2F%2Fxyz.com)&per_page=200&page=1
GET /crm/v2/Contacts?per_page=200&page=1
GET /crm/v2/Contacts?per_page=200&page=2
GET /crm/v2/Contacts?per_page=200&page=3
GET /crm/v2/Contacts?per_page=200&page=4
GET /crm/v2/Contacts?per_page=200&page=5
...
...

version: 1.9.1034
EF provider: Devart.Data.Zoho.Entity.EF6

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect for Zoho CRM - Using Include() on IQueryable tries to download every enitity in DB

Post by Shalex » Wed 25 Dec 2019 18:14

The suggested searching based on Account_Name or using the Related Lists API uses fewer API calls when a filter applied on Accounts returns 1 or several accounts. In the case of many accounts, there will be no gain in API calls count.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect for Zoho CRM - Using Include() on IQueryable tries to download every enitity in DB

Post by Shalex » Wed 25 Dec 2019 18:15

We will investigate the question. There is no timeframe.

Post Reply