Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Incidents-RetrieveMultiple/WebApiFetch for one user is slow

(0) ShareShare
ReportReport
Posted on by 311

Hello,

we are using CRM 2016/365 OnPrem. RetrieveMultiple for specific user of incidents via SDK or via WebAPI is very slow. E.g.15- 25 seconds. The same for other entities for the same user or for incidents with other user credentials ist much quicker . It takes 1-2 seconds.

Access is made via WebApi (https:/servername/orgname/api/data/v8.2/incidents?$top=11 )or via small code sample:

             var req = new QueryExpression("incident");
            req.ColumnSet = new ColumnSet(true);
            req.TopCount = new Random().Next(5, 100);
            var time1 = DateTime.Now;
            var ec = client.RetrieveMultiple(req);
            var duration = DateTime.Now - time1;

(Randomisation is adder to the code sample because without randomization it runs quickly - probably because of cacheing, but that is not what I need.  Also it runns quick  when the "top" parameter in the WebAPI url is not changed for every query.)

About my system:

  • Access through Browser to Incident-Views and AdvancedFind of incidents is quick for the user.
  • The structure of BusinessUnits is very simple (no subordinated BUs).
  • The user has only two roles which are failry simple. One of them grants full access to Incidents in the same BU and subordinated BUs.
  • There are no RetrieveMultiple-SdkProcessingSteps.
  • POA table doesn't contain record for Incidents for specific user (it has only two rows for the user)

Already tried:

  • adding some new rolle to the user in Order to have eventally used Security-Cacheing/POA recalculated.
  • Adding sysadmin role helps, but this is not what I want.
  • updating RecentlyViewedXml field in the UserEntityUISettingsBase (Update UserEntityUISettingsBase set RecentlyViewedXml = null where ownerid ='xxx' and objecttypecode =112) and deleting the record in the UserEntityUISettingsBase. But it didn't help.
  • Suggested answer
    Nikica Profile Picture
    Nikica 311 on at
    RE: Incidents-RetrieveMultiple/WebApiFetch for one user is slow

    Well it looks like fetching all columns makes Retrieve so slow. Incident has like 400 attributes, 70 lookups. When all fetched - it takes 15-25 seconds. Wenn only 10-20 it is very fast. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans