Tag: crm

为什么我的CRM插件中的所有引用属性都为null?

我正在使用早期绑定在联系人实体上编写PostUpdate插件。 不幸的是,所有应该代表1:x关系的属性都是null。 代码非常简单: * CRMcontext是通过CrmSvcUtil.exe生成的文件, * service是LocalPluginContext的IOrganizationService: using ( var serviceContext = new CRMcontext(service) ) { // This works fine var contact = serviceContext.CreateQuery().First(c => c.Id == context.PrimaryEntityId); // why is currency null after this line?! (and yes, it’s set in the entity) var currency = contact.transactioncurrency_contact; } 我按照这个例子(最后一个代码片段): http : //msdn.microsoft.com/en-us/library/gg695791.aspx 谢谢你的帮助! 编辑: /// […]

在function区中创建一个按钮,使用crm 2011中的插件更新实体

我在Dynamic CRM 2011中创建了一个用于发送SMS的解决方案。 在我的解决方案中,我有2个实体,第一个用于发送短信,第二个用于保存发送结果。 我为第二个实体创建插件,插件连接到Web服务并检查发送和更新实体的结果,因此更新发送雕像的步骤应如下所示: 1-用户选择一个或多个实体,然后按function区中的自定义按钮 2- CRM运行我的插件并连接到Web服务并更新结果字段 所以我创建插件并创建按钮但我不知道如何在按下按钮时运行插件(C#代码)。 如果有人知道这个或有更好的解决方案更新短信结果,请告诉我。 注意:我为插件注册了更新步骤和预映像。 请帮我。

获取DateTime CRM 2011

我在使用DateTime时遇到了一些问题:使用Fetch 认为这有点错了…. 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 = ((DateTime)((AliasedValue)a[“new_duedate”]).Value); 然后我添加到新的实体… if (scheduledstart != null) { Activity.Attributes.Add(“scheduledstart”, scheduledstart); } if (enddate != null) { Activity.Attributes.Add(“scheduledend”, enddate); } if (scheduledend != null) { Activity.Attributes.Add(“scheduledend”, scheduledend); } 任何想法如何使用来自fetch的AliasedValue编写DateTime? 或者更好的方法来做到这一点> 谢谢

使用带有Microsoft Dynamics CRM 2013联机插件的Web服务

我在连接到用于MS Dynamics 2013插件的Web服务时遇到问题(在沙箱模式下运行,因为它在MS托管的在线版本上,而不是内部版本) 我面临的问题是,我似乎无法连接到我需要用来实现我正在尝试做的事情的Web服务。 我最初在app.config中有了web服务绑定,但我很快就知道app.config在这种情况下是无关紧要的(?),所以我继续在代码中创建绑定。 这是我提出的代码: BasicHttpBinding myBinding = new BasicHttpBinding(); myBinding.Name = “BasicHttpBinding_IClientSearch”; myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None; myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName; myBinding.MaxBufferSize = 524288; myBinding.MaxBufferPoolSize = 524288; myBinding.MaxReceivedMessageSize = 524288; myBinding.ReaderQuotas.MaxDepth = 32; myBinding.ReaderQuotas.MaxArrayLength = 524288; myBinding.ReaderQuotas.MaxStringContentLength = 524288; myBinding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential; EndpointAddress endPointAddress = new EndpointAddress(EndPointURL); ClientSearchService.ClientSearchClient myClient = new ClientSearchService.ClientSearchClient(myBinding, endPointAddress); […]

C#中的Dynamics CRM SDK使用无效密码连接

我正在开发一个C#应用程序,用于从Dynamics CRM Online检索数据。 要validationDynamics CRM的用户名和密码,我使用的是WhoAmIRequest。 它工作正常,直到出现以下情况。 1)使用有效URL,用户名和密码连接Dynamics CRM。 2)处置组织服务对象。 3)使用有效URL,用户名和无效密码重新连接Dynamics CRM。 在这种情况下,WhoAmIRequest也成功执行了。 但它应该失败。 以下是我正在使用的代码: private void button6_Click(object sender, EventArgs e) { CrmConnection connection; string url = “Url=https://mytest.crm.dynamics.com ;Username=mytest@mytest.onmicrosoft.com; Password=goodpassword;”; connection = CrmConnection.Parse(url); OrganizationService orgService = new OrganizationService(connection); Guid userid = ((WhoAmIResponse)orgService.Execute(new WhoAmIRequest())).UserId; if (userid == null) MessageBox.Show(“Login Failed”); else MessageBox.Show(“Login Success”); orgService.Dispose(); url = “Url=https://mytest.crm.dynamics.com […]

检索在optionset字段中选择的值,并在文本字段中显示该值

任何人都可以帮我在文本字段中显示一个optionset字段值..? 我想检索在optionset中选择的值,并使用插件在文本字段中显示相同的值。我在“case”实体的“update”上写这个插件…

Update-Plugin CRM 2011上的实体前和实体后图像

我希望somone可以帮助我解决一段时间以来我一直试图解决的问题。 我有一个创建插件和一个更新插件。 出于测试目的,我的create plugin(Pre-Operation)执行简单的计算,并在保存后将结果放在字段上。 当我在预操作上注册并更改我的逻辑字段时,我的update-plugin工作正常。 但是,如果我只更改其中一个字段(或在表单上弄脏其他字段),我会收到一个错误,即密钥不在字典中。 我已经完成了我的研究,并看到您在前后实体图像之间进行检查,以检查哪些字段已更新,哪些字段未更新。 但令我困惑的是,当我这样做时,我需要在Post-opertion上注册我的更新插件,这导致我的更新不再工作,如果我在我的代码结尾处做service.Update(实体)它给出我是无限循环的另一个错误。 在我的Update插件中,我确保我注册了两个图像(Pre和Post)。 如果有人可以建议我,如何在前后图像之间进行检查,我将不胜感激?

如何解决Dynamics CRM插件System.Security.Permissions.FileIOPermission错误

业务流程错误 System.Security.SecurityException:请求类型为’ System.Security.Permissions.FileIOPermission ,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089’的权限失败。 System.Security上的System.Security.CodeAccessSecurityEngine.Check(Object demand,StackCrawlMark和stackMark,Boolean isPermSet)处于System.IO.FileStream.Init的System.Security.CodeAccessPermission.Demand()处(字符串路径,FileMode模式,FileAccess访问,Int32权限,布尔值) System.IO.FileStream..ctor中的useRights,FileShare共享,Int32 bufferSize,FileOptions选项,SECURITY_ATTRIBUTES secAttrs,String msgPath,Boolean bFromProxy,Boolean useLongPath,Boolean checkHost)(字符串路径,FileMode模式,FileAccess访问,FileShare共享,Int32 bufferSize ,FileOptions选项,String msgPath,Boolean bFromProxy,Boolean useLongPath,Boolean checkHost)at System.IO.File.InternalWriteAllBytes(String path,Byte [] bytes,Boolean checkHost)at RetrieveAttachments.RetrieveClass.Execute(IServiceProvider serviceProvider)失败的操作是:需要失败的第一个权限的类型是:System.Security.Permissions.FileIOPermission失败的程序集区域是:MyComputer 我还在插件AssemblyInfo.cs文件[assembly:System.Security.AllowPartiallyTrustedCallers]中添加了以下方法,但它引发了同样的错误。 QueryExpression notes = new QueryExpression { EntityName = “annotation”, ColumnSet = new ColumnSet(“filename”, “subject”, “annotationid”, “documentbody”,”mimetype”) }; notes.Criteria.AddCondition(“annotationid”, ConditionOperator.Equal, annotationid); EntityCollection […]

使用OrderClose类时无法编译代码

我正在尝试构建一个在销售订单上执行某些操作的插件。 我还必须将订单设置为已履行。 我在SDK文档中找到了必须用于以正确方式完成订单的提取 var request = new FulfillSalesOrderRequest { OrderClose = new OrderClose { SalesOrderId = new EntityReference { LogicalName = orderEntityName, Id = orderId } }, Status = new OptionSetValue(newStatus) }; 问题是代码无法编译,因为MVS说“无法找到类型或命名空间名称’OrderClose’(你是否缺少using指令或程序集引用?)”。 右键单击“new OrderClose”(OrderClose带有红色下划线)我看不到菜单中的Resolve部分。 我也尝试过这种方式: var request = new FulfillSalesOrderRequest(); request.OrderClose = new OrderClose(); request.OrderClose.LogicalName = orderEntityName; request.OrderClose.Id = orderId; request.Status = new OptionSetValue(newStatus); […]

在CRM 2015中禁用表单上的所有字段

嗨,我希望在使用插件或Jscript保存时禁用CRM 2015中的所有字段