dynamics-crm-2011

The provided URI scheme 'https' is invalid; expected 'http' when calling web service

空扰寡人 提交于 2019-11-29 09:20:17
I am trying to call a SharePoint web service from a CRM workflow using custom C# code. However when I run my code, I get the following error: The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via Here is the offending code: #region Set up security binding and service endpoint BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly); binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm; binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm; EndpointAddress endpoint = new

“EntityState must be set to null, Created (for Create message) or Changed (for Update message)” when attempting to update an entity in CRM 2011

不羁的心 提交于 2019-11-29 09:15:56
I am using the following code to update an entity. Service.Update(_policy); where policy is a class generated using CrmSvcUtil.exe public partial class new_policy : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged I retrieve the policies using LINQ, then update one attribute (an EntityReference) and then attempt the update When this code runs I get the following error message: EntityState must be set to null, Created (for Create message) or Changed (for Update message) There are other entities generated in the same way that I

crm 2011 how to hide/show the ribbon button with javascript

徘徊边缘 提交于 2019-11-29 07:56:03
I am trying to hide/show a button from CRM 2011 Ribbon on the bases of a condition defined in JavaScript . JavaScript function returns the true/false . So I wan't to change the XML to Hide/Show the button. I have tried to do it as below, but without any luck. Can anyone suggest me correct approach. Thanks in Advance <RibbonDiffXml> <CustomActions> <CustomAction Id="Email.Form.email.MainTab.Send.CustomAction" Location="Mscrm.Form.email.Send" Sequence="2"> <CommandUIDefinition> <Button Id="Mscrm.Form.email.Send" Command="Mscrm.Form.email.Send_Custom" Sequence="1" Alt="$Resources:Ribbon.Form

How to get the option set from a field in an entity in CRM 2011 using crm sdk and C#

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 07:47:59
How to get the option set from a field in an entity in CRM 2011 using crm sdk and C#? I just want to share with you guys a direct approach on getting the option set of a field in an entity. The proper way to retrieve metadata information in Dynamics CRM is to retrieve only the information required. We should only retrieve the option set values based on the original question. Retrieving all the metadata for an entity when all the requirement specifies is the values for an Option Set is unnecessary and will create unnecessary overhead. Here is the correct way to get the list of options for an

Build Entity Form Url

蹲街弑〆低调 提交于 2019-11-29 00:12:56
a Microsoft CRM 2011 question. Given the following parameters: An entity schema name (i.e. opportunity, new_customentity) An entity guid A CRM organization base url (i.e. http://myhost.com/ORGNAME/ ) How can I build an url to point to the main (or "default") form of that record? I can tell a pattern in form urls, but some querystring params are pretty obscure and I wouldn't know how to reuse them for any other kind of entity. In addition, version 4.0 had specific URLs (/sfa/, etc) for system entities. It doesn't seem to be the case anymore. Any help would be appreciated - thanks. (additional

Dynamics CRM - Accessing Custom Product Option Value

*爱你&永不变心* 提交于 2019-11-28 14:16:21
Is there a way to programmatically access the Label & Value fields that has been created as a custom Field in MS CRM Dynamics please? I have added a custom field called "new_producttypesubcode" which, for example, has 2 options, Trophy = 1000000 and Kit = 10000001. I am writing an import utility that mirrors products between the customers website and their CRM and I want to get a list of all possible product options in the CRM to see if they are matched in the website. So, in essence I want to... get the list of possible new_producttypesubcodes and their corresponding values. Iterate through

How to get current user privileges in MS Dynamics CRM on server side

倾然丶 夕夏残阳落幕 提交于 2019-11-28 13:44:17
I'm working on MS CRM plugin, and it should be able to determine whether the current user has write access to the current entity. I don't know how to approach this task. It seems that the most user-friendly way accomplish this task is currently unsupported . Is there any alternative in MS CRM 2011 SDK, except composing a FetchXML query and parsing its output? Here is what I have come up with — this code will check, does current user has given privilege on current record: // Requesting user's access rights to current record var principalAccessRequest = new RetrievePrincipalAccessRequest {

Error within Where statement in LINQ

…衆ロ難τιáo~ 提交于 2019-11-28 13:29:17
For some reason in my where it says that "firstname" does not exist in the Opportunity Entity. But it is set for the SystemUser Entity. Any idea why it is getting confused? Thanks! var linqQuery = (from r in gServiceContext.CreateQuery("opportunity") join c in gServiceContext.CreateQuery("account") on ((EntityReference)r["accountid"]).Id equals c["accountid"] join u in gServiceContext.CreateQuery("systemuser") on ((EntityReference)r["ownerid"]).Id equals u["systemuserid"] where r["new_leadstatus"].Equals("100000004") && u["lastname"].Equals(rsmLastName) && u["firstname"].Equals(rsmFirstName)

How to Connect to CRM Dynamics Online Odata endpoint LinqPad?

亡梦爱人 提交于 2019-11-28 12:48:21
I'm able to connect to self-hosted CRM sites just fine with the default Odata driver within LinqPad. The URI I use in the "WCF Data Services (OData) Connection" dialog for self-hosted is in the format http://MyServer.com/MyOrgName/xrmservices/2011/OrganizationData.svc . The user name is in the format "domain\username". When I attempt to follow the same format for an CRM Online instance, it doesn't work. I'm guessing it's either because of the https, or the windows live credentials, but don't know what steps to take to fix the problem... Please note, I want to use the odata provider, not the

Can I update the owner id of a Contact using LINQ?

旧街凉风 提交于 2019-11-28 11:16:51
I'm using CRM 2011, and attempting to update the OwnerId of contact using this code: var crmContext = new CustomCrmContext(service); var contact = crmContext.Contact.FirstOrDefault(c=>c.Id == id); contact.OwnerId.Id= newOwnerId; crmContext.UpdateObject(contact); crmContext.SaveChanges(); I don't get any errors, however, the ownerId never updates in the database. I am able to update other attributes, but I'm just wondering if maybe the OwnerId is special and you have to use OrganizationRequest("Assign")? If so, where is this documented so I know what other attributes I cannot update? The owner