There is currently a problem with our slow response time (more than 1 minute) when we request CRM from our website. We use CRM 2011, although a web service. When we researched, we found that the time was spent at the time of the CRM request.
We used CrmSvcUtil.exe to generate our proxy classes that map to CRM objects. Then we instantiate the context and the CRM request using LINQ with C #.
When we request, we load the parent from LINQ into CRM, and then we use LoadProperty to load the related children.
I would like to find out if anyone is there using another CRM request method, and if you encounter such problems in your implementation.
Ive included a simplified sample example below.
public void SelectEventById(Guid id) { var crmEventDelivery = this.ServiceContext.EventDeliverySet.FirstOrDefault(eventDelivery => eventDelivery.Id == id); if (crmEventDelivery != null) { this.SelectCrmEventDeliveryWithRelationships(crmEventDelivery); } } private void SelectCrmEventDeliveryWithRelationships(EventDelivery crmEventDelivery) { // Loading List of Venue Delivery on parent crmEventDelivery thats been passed this.ServiceContext.LoadProperty(crmEventDelivery, Attributes.EventDelivery.eventdelivery_venuedelivery); foreach (var venueDelivery in crmEventDelivery.eventdelivery_venuedelivery) { // Loading Venue on each Venue Delivery ServiceContext.LoadProperty(venueDelivery, Attributes.VenueDelivery.venue_venuedelivery); } // Loading List of Session Delivery on parent crmEventDelivery thats been passed this.ServiceContext.LoadProperty(crmEventDelivery, Attributes.EventDelivery.eventdelivery_sessiondelivery); foreach (var sessionDelivery in crmEventDelivery.eventdelivery_sessiondelivery) { // Loading Presenters on each Session Delivery ServiceContext.LoadProperty(sessionDelivery, Attributes.SessionDelivery.sessiondelivery_presenterbooking); } }
source share