dynamics-crm-2011

Error settings breakpoints but only on some lines while debugging

拜拜、爱过 提交于 2019-12-11 03:25:54
问题 This line is causing the "key not found" in the PostEntityImages collection. Entity pimage = _context.PostEntityImages["postcreate"]; When I put a break point on that line and put it in the watch window it works fine and that key is present. UPDATE: protected override void ExecutePlugin() { try { Entity pimage = null; if (_context.PostEntityImages.ContainsKey("postcreate")) pimage = _context.PostEntityImages["postcreate"]; } catch (Exception) { // Never hits this line throw; } } // When

Unhandled exception on SaveChanges CRM 2011 plugin

余生长醉 提交于 2019-12-11 03:01:14
问题 I have a problem in my CRM 2011 plugin. var QuoteProduct = crm.QuoteDetailSet.Where(c => c.QuoteDetailId == QPID).First(); double Tax = (double)( (QuoteProduct.BaseAmount - QuoteProduct.ManualDiscountAmount.GetValueOrDefault() - QuoteProduct.VolumeDiscountAmount.GetValueOrDefault()) / 20); QuoteProduct.Attributes["tax"] = Tax; crm.UpdateObject(QuoteProduct); crm.SaveChanges(); The error occurs on the save changes line. The error details are as follows. Microsoft.Xrm.Sdk.SaveChangesException

Using Group in LINQ Query

邮差的信 提交于 2019-12-11 02:48:34
问题 I am using the LINQ to CRM provider. I am querying the information then I am using LINQ to query the LINQ to CRM query so I can use GroupBy, since the LINQ to CRM provider does not support it. This is what I have so far. var linqQuery = (from r in orgServiceContext.CreateQuery("opportunity") join c in orgServiceContext.CreateQuery("contact") on ((EntityReference)r["new_contact"]).Id equals c["contactid"] into opp from o in opp.DefaultIfEmpty() select new { OpportunityId = !r.Contains(

CRM 2011 sdk - obtaining count of entities without retrieving rows of data

我的梦境 提交于 2019-12-11 02:39:08
问题 I am using the CRM 2011 SDK to work with a remote CRM 2011 service. I need to retrieve the total number of contacts, which is something over 20000. I've tried a simple LINQ query, eg. Aggregate c In service.ContactSet Into Count() (from these examples, also this suggestion and this suggestion) but each one took ages , because the resulting XML that gets downloaded is an entire recordset of data (even if it's only the GUID, that's still 20000 GUIDs and all their XML fluff). I can't seem to

how to hide a pre-filter window in CRM 2011?

这一生的挚爱 提交于 2019-12-11 02:13:25
问题 I'm looking for a way how to hide a pre-filter in CRM 2011. I created a sipmle report by using business intelligent studio. Eventially, the reports shows a table with data (SQL query like select column1, column2....from table) when I open it in CRM I get a window where I have to built filter. Is there any way avoid such window? I found that I cand set a query in filter by default but anyway It doesn't help except this screen thanks in advance 回答1: To remove the pre-filter page, you have to

Dynamics CRM SDK - IN operator for linq with OrganizationServiceContext

送分小仙女□ 提交于 2019-12-11 01:59:05
问题 I'm using my OrganizationServiceContext implementation generated by the svcutil to retrieve entities from CRM: context.new_productSet.First(p => p.new_name == "Product 1"); Is it possible to retrieve multiple entities with different attribute values at once - (smth like IN operator in SQL)? Example: I would like to retrieve multiple products ("Product 1", "Product 2", ...) with a single call. The list of product names is dynamic, stored in an array called productNames. 回答1: No, you can't. CRM

Xrm.Page.data is null

筅森魡賤 提交于 2019-12-11 01:57:34
问题 I have added a custom form on the opportunity entity and have some javascript attached to it. I'm calling the form using window.open and the formId in the url to open the form and is only used to create opportunity entities. Inside the javascript I'm simply trying to populate some fields but the Xrm.Page.data object is always null. $(document).ready(function () { Xrm.Page.getAttribute("ct_testfield").setValue('test');}); Thanks! Jon UPDATE: Apparently $(document).ready() fires before the Xrm

WebApi Deployed to Azure - Controllers Don't Work (500 Error)

喜夏-厌秋 提交于 2019-12-11 01:54:48
问题 I have a WebApi project that wraps the Dynamics CRM Online web service and provides a REST api. I have a simple controller that gets some contacts from CRM and returns them to the caller. Everything works fine when I run it in the local emulator. However, when I deploy the project to Azure, I can reach the home page, but the controllers all return http 500 errors. Why would this happen? And how can I troubleshoot to get more details? UPDATE The issue is with the absence of Microsoft

What happens to recurring workflows once the async service is restarted?

给你一囗甜甜゛ 提交于 2019-12-11 01:38:34
问题 Our org is planning on basing parts of our business model on the premise of recurring workflows in CRM 2011. However, we sometimes run into an issue with a backed up workflow queue, or for some reason need to restart the server (update rollups, etc.), or in some other way find we have to restart the CRM's async service. What would happen to any workflows in the "waiting" phase in this scenario? I see the workflow in the AsyncOperationBase table with the "waiting" statuscode ; when the service

Dynamics CRM 2011 - Filtering LINQ query with outer joins

痞子三分冷 提交于 2019-12-11 01:35:11
问题 I have a requirement to query for records in CRM that don't have a related entity of a certain type. Normally, I would do this with an Left Outer Join, then filter for all the rows that have NULLs in the right-hand side. For example: var query = from c in orgContext.CreateQuery<Contact>() join aj in orgContext.CreateQuery<Account>() on c.ContactId equals aj.PrimaryContactId.Id into wonk from a in wonk.DefaultIfEmpty() where a.Name == null select new Contact { FirstName = c.FirstName, LastName