如何更新 Dynamics CRM 2011 的 silverlight/odata 项目中的状态(打开、完成)
我有一个在线托管在 CRM 2011 中的 silverlight 应用程序。我有功能可以更新电话并以小形式显示两个字段。我需要标记为完成,但我似乎在这里失败了。
我有:
phoneCall.StateCode.Value = 1;
phoneCall.Subject = activity.Subject;
phoneCall.Description = activity.Description;
_context.UpdateObject(phoneCall);
_context.BeginSaveChanges(OnChangesSaved, phoneCall);
主题可以正常工作并保存以及描述,但状态代码不能。 StateCode 不为 null,这是一个现有对象,当前设置为 0(打开)。保存不会影响 StateCode。我在 try-catch 中有这个,没有报告错误。
I have a silverlight app hosted in CRM 2011 online. I have functionality where I am updating a phone call and display two fields in a small form. I have the requirement to mark as complete but I seem to be failing here.
I have:
phoneCall.StateCode.Value = 1;
phoneCall.Subject = activity.Subject;
phoneCall.Description = activity.Description;
_context.UpdateObject(phoneCall);
_context.BeginSaveChanges(OnChangesSaved, phoneCall);
The subject works and saves as well as the description but the statecode does not. StateCode is not null this is an existing object and it's currently set to 0 (open). The save does not affect the StateCode. I have this in a try-catch and no error is being reported.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
记录的状态无法通过
Update
消息更改。为了更改状态代码或状态代码,您必须发出SetStateRequest
。更新
REST 端点有一些限制。
这对您来说意味着:您无法使用 REST 端点更改状态。您必须使用 WCF SOAP 端点来执行此任务。
The status of a record cannot be changed with an
Update
message. In order to change the statecode or status code, you have to issue aSetStateRequest
.Update
The REST endpoint has some limitations.
This means for you: you cannot alter the state with the REST endpoint. You have to use the WCF SOAP endpoint for this task.