dynamics-crm-2011

Dynamics CRM saving Entity Changes - Getting Errors

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 07:26:54
问题 I'm really scratching my head with this. I'm trying to use the Dynamics CRM SDK to update an account record. No matter what I try, it's failing. Here goes. Account sampleAccount = CrmAccount.GetAccountsBySubmissionCode(crmService, "ERZZUP").Single<Account>(); sampleAccount.Name = "AMC Edited"; crmService.Update(sampleAccount); Gives the error: EntityState must be set to null, Created (for Create message) or Changed (for Update message) XrmServiceContext ctx = new XrmServiceContext(crmService)

Dynamically Construct Linq in CRM 2011

戏子无情 提交于 2019-12-07 06:53:29
I am trying to retrieve all records of an entity with Linq with the condition that one of the properties that are true in the parameter are true in the record. I am trying to achieve a logical 'or', please look at the code as it will make more sense there. In FetchXML it is working: public void GetLock(bool account = false, bool contact = false, bool incident = false) { var fetch = @" <fetch mapping='logical'> <entity name='de_processimport'> <attribute name='de_processimportid' /> <filter type='or'>"; if (account) fetch += @"<condition attribute='de_processingaccount' operator='eq' value=

CRM 2011 SDK transaction

泪湿孤枕 提交于 2019-12-07 06:28:50
问题 How to create transaction using crm 2011 sdk and XrmServiceContext? In next example 'new_brand' is some custom entity. I want to create three brands. Third has wrong OwnerID guid. When I call SaveChanges() method, two brands are created and I've got exception. How to rollback creating of first two brands? Is it possible without using pluggins and workflows? using (var context = new XrmServiceContext(connection)) { SystemUser owner = context.SystemUserSet.FirstOrDefault(s => s.Id == new Guid(

CRM 2011 - Retrieving FormattedValues from joined entity

北战南征 提交于 2019-12-07 06:20:17
问题 I've been converting some of my CRM4.0 plugins to use the CRM2011 SDK. I'm just starting to work with LINQ for Early-Bound entities and have come across a problem. I am trying to get the formatted value of an OptionSetValue in a joined entity. After looking at this MSDN SDK Query Example, I managed to retrieve the formatted values for the primary entity, but can't seem to translate that to a joined entity. The code below is a sample of what I'm trying to achieve. I started by using the code

How to Authenticate to CRM 2011?

只谈情不闲聊 提交于 2019-12-07 05:56:02
问题 I would like to build a simple web site where a customer can place orders and view products. This data is my Microsoft Dynamics CRM 2011 Environment. This data is customer specific, so i need information about the user which is logged in. User credentials are stored in CRM 2011. With these credentials users may login to this new custom website. They should not have access to the crm environment itself. How should i setup authentication for this web site? Can i just query the user information

Strange behavior CRM 2011 plugin

喜夏-厌秋 提交于 2019-12-07 05:00:15
问题 I have registered a plugin for our quote products. The plugin worked well in our test environment. I have tested it lots of times. Then registered the plugin in the main server. However, the below scenario occurs: When I create or update the quote products first the quote product form greys out: After I click on the quote form the error appears. No log files are available (as you see). I debugged the plugin, but there is no error also. After I click the OK, the error disappears and the

CRM 2011 Remove unwanted menu entry

我的梦境 提交于 2019-12-07 04:44:31
问题 I want to remove the "New" option in a entry on the main menu. Its that little right arrow that allows the user to see this menu at all, I'd be okay with completely removing that. Here is what the element looks like in my sitemap: <SubArea Id="nav_cases" Entity="incident" DescriptionResourceId="Cases_SubArea_Description" GetStartedPanePath="Cases_Web_User_Visor.html" GetStartedPanePathAdmin="Cases_Web_Admin_Visor.html" GetStartedPanePathOutlook="Cases_Outlook_User_Visor.html"

Is It Beneficial To Call ExecuteMultipleRequest From Within A Plugin?

若如初见. 提交于 2019-12-07 02:50:54
问题 I know the ExecuteMultipleRequest is a huge performance booster when performing batch updates from outside of CRM. What I don't know is if it is beneficial to call it from within a CRM plugin. My current understanding is that the main performance gain from using the ExecuteMultipleRequest is in the actual SOAP messaging costs. So (for updating 5000 records) rather than sending 5000 separate Soap messages (each having to be serialized, authenticated, transferred, etc), that all have to be sent

How to filter w.r.t. multiple fields in oData using $filter?

此生再无相见时 提交于 2019-12-07 02:48:40
问题 What is the correct way to filter w.r.t. multiple fields when applying $filter command on more than one field/value pair from JavaScript? 回答1: It's very canonical. http://192.168.75.8:5555/Konrad01/ xrmservices/2011/OrganizationData.svc/ LeadSet%28%29?$filter= Field1%20eq%20%27Value1%27%20and%20Field2%20eq%20%27Value2%27 EDIT: More readable version. http://Server:Port/Organization/XrmServices/2011/OrganizationData.svc/ LeadSet()?$filter=Field1 eq 'Value1' and Field2 eq 'Value2' 回答2: Put an

CRM 2011 Custom Workflow

坚强是说给别人听的谎言 提交于 2019-12-06 22:12:43
I GO THE PLUGIN WORKING, AND I HAVE UPDATED THE WORKING CODE HERE. HOPE IT HELPS!! I'm creating a workflow which has a plugin to retrieve a contact entity from a "FROM" field of an Email record. I'm trying to see if that email exists in the contact entity. The input is the "FROM" email and the output will return the Contacts entity. I have not been able to get this code working, I've received different errors or no errors, but I know its not working. Please help! Thanks in advance! using System.Activities; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Workflow; using Microsoft.Xrm.Sdk.Query