繁体   English   中英

Dynamics CRM获取扩展属性

[英]Dynamics CRM get extension attribute

我已经为系统实体创建了一个自定义字段。 如何通过后期绑定通过XRM Web服务访问属性值?

我正在使用此代码,但它给了我EntityReference对象:

Entity objCase = service.Retrieve("incident", new Guid(Request.QueryString["EntityID"]), attributes);
string strValue = objCase.Attributes["new_papid"]).ToString();

您正在检索查找值,在这种情况下,您需要先强制转换为Entity Reference

Entity objCase = service.Retrieve("incident", new Guid(Request.QueryString["EntityID"]), attributes);
EntityReference pap = (EntityReference)objCase.Attributes["new_papid"];
Guid papId = pap.Id; // ID of the record;
string papName = pap.Name; // Primary attribute of the entity;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM