dynamics-crm-2011

Dynamics Crm: creating Connection entities via API

为君一笑 提交于 2019-12-06 05:35:33
So Connections in Dynamics CRM provide a general purpose way of linking things together. Internally the Connections entity has a Record1Id attribute and a Record2Id attribute, among other things. When you create a connection via the UI , CRM actually " creates two entries in the Connection table in the database. Each entry allows you to search for the related record from the originating record or the related record. " That is, if you connect A and B, it saves two rows to the (behind the scenes) table: one with Record1Id = A and Record2Id = B and one with Record1Id = B and Record2Id = A This is

I need to set the State and StatusCode of a custom entity

妖精的绣舞 提交于 2019-12-06 05:34:12
问题 I need to set the State and StatusCode of a custom entity using the .Net CRM SDK . The following code executes but the StatusCode isn't changed when I check on the entity form. private void SetState(Entity entity, int statuscode) { SetStateRequest setState = new SetStateRequest { EntityMoniker = new EntityReference( entity.LogicalName, new Guid(entity.Id.ToString())), State = new OptionSetValue(0), Status = new OptionSetValue(statuscode) }; SetStateResponse myres = (SetStateResponse)svc

CRM 2011 SecurityNegotiationException trying to access web services

一笑奈何 提交于 2019-12-06 05:26:15
Getting an unexpected error when trying to connect to CRM 2011 web service. Here's the background: Connection String (with sensitive info removed): "ServiceUri=https://crmdomain.com/OrgName/XRMServices/2011/Organization.svc; Url=https://crmdomain.com/OrgName; Username=appusername; Password=hidden"/> Creating the connection as follows: Parse conn string into CRMConnection: var conn = Microsoft.Xrm.Client.CrmConnection.Parse(connString); (at this point, the properties in the CrmConnection object look correct, including ClientCredentials) Create org proxy: var orgProxy = new

Fetch DateTime CRM 2011

空扰寡人 提交于 2019-12-06 04:10:33
Im having some trouble with DateTime: Using Fetch <attribute name='new_startdate' groupby='true' dategrouping='day' alias='new_startdate' /> <attribute name='new_enddate' groupby='true' dategrouping='day' alias='new_enddate' /> <attribute name='new_duedate' groupby='true' dategrouping='day' alias='new_duedate' /> Think this is the bit thats Wrong.... DateTime scheduledstart = ((DateTime)((AliasedValue)a["new_startdate"]).Value); tracer.Trace("DateTime 1 Done"); DateTime enddate = ((DateTime)((AliasedValue)a["new_enddate"]).Value); tracer.Trace("DateTime 2 Done"); DateTime scheduledend = (

AppDomain.CurrentDomain.AssemblyResolve in dynamics crm

柔情痞子 提交于 2019-12-06 04:04:13
问题 So, I've come by many articles referencing the use of AppDomain.CurrentDomain.AssemblyResolve to load DLLs from embedded resources into a plugin at runtime (without the use of IlMerge). However, when I insert this code, the event handler never receives the thread before the plugin throws a TypeLoadException message for my main library. I have tried placing the code in a static constructor, inside of the Execute method and in the main constructor; and although the event handler is registered,

Issue with mocking IOrganizationService.Execute in CRM 2011 plugin

偶尔善良 提交于 2019-12-06 01:41:44
I am still new to mocking and I am having trouble with this code: //create the request SendEmailFromTemplateRequest emailUsingTemplateReq = new SendEmailFromTemplateRequest { Target = email, TemplateId = new Guid("07B94C1D-C85F-492F-B120-F0A743C540E6"), RegardingId = toParty[0].PartyId.Id, RegardingType = toParty[0].PartyId.LogicalName }; //retrieve response SendEmailFromTemplateResponse emailUsingTemplateResponse = (SendEmailFromTemplateResponse)service.Execute(emailUsingTemplateReq); var emailId = emailUsingTemplateResponse.Id; I have had no problems up to this point mocking the

CRM Retrieve entity - Error: Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type 'CRMEntities.List'

拥有回忆 提交于 2019-12-06 01:40:06
问题 I generated entities from CRM like this: CrmSvcUtil.exe /url:http://<servername>/<organizationname>/XRMServices/2011/Organization.svc /out:<outputfilename>.cs /username:<username> /password:<password> /domain:<domainname> /namespace:CRMEntities /serviceContextName:XrmServiceContext For serviceContextName I set XrmServiceContext . I want to retrieve some entity from CRM using next code: var context = new XrmServiceContext(myorgserv); var marketingList = context.ListSet.Where(item => item.Id ==

Dynamics CRM - Caller not authenticated to service

僤鯓⒐⒋嵵緔 提交于 2019-12-06 00:10:52
I have an MVC4 Web Application on Web Server A that is consuming the Dynamics CRM Web Service using the OrganizationServiceProxy, which is on Web Server B. The MVC4 application is setup with ASP .NET Impersonation and Windows Authentication enabled. When I call the WhoAmI I get an error: 'The caller was not authenticated by the service.' Now if I move the MVC4 Application to Web Server B (same as CRM) with the same Authentication as it had on Web Server A it calls WhoAmI without an exception. Here is the code being used to connect to the server. string serviceURL = ConfigurationManager

MS Dynamics CRM 2012: Script Editor Enhancements

谁说我不能喝 提交于 2019-12-05 22:04:35
I have been trying to find some more information about the next Microsoft Dynamics CRM product (2012 / 6). Mainly I am interested in any enhancements that will be made to the scripting editor. There was great improvements between version 4 and 5 (2011), the most welcome for me being the ability to share script functions across form/field events. What I really miss though is the complete lack of formatting in the editors. Yes, it would be great to have intellisense and the likes, but I would be happy just to settle for a better formatting function (auto-tab) and some highlighting for better

CRM 2011 generated code using ICodeWriterFilterService fails to build

会有一股神秘感。 提交于 2019-12-05 21:55:17
Using the sample code at http://erikpool.blogspot.com/2011/03/filtering-generated-entities-with.html I have altered this so that GenerateEntity and GenerateOptionSet to have the code: return optionSetMetadata.Name.ToLowerInvariant().StartsWith("myprefix"); This generates the types including some enumerations for the optionsets. The actual implementation of the optionset in the entity doesn't use this however, but I get the following: [Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("myprefix_fieldname")] public Microsoft.Xrm.Sdk.OptionSetValue myprefix_FieldName { get { Microsoft.Xrm.Sdk