【发布时间】:2014-08-22 10:47:50
【问题描述】:
我目前需要检索子网格中存在的属性,我之前的做法是使用带有 FetchXML 查询的 C# 插件来检索该属性。
但是,我想检索属性并将其上下文放入 CRM 表单上的字段中。因此,我在 JavaScript Web 资源中构建了以下内容
function getProduct()
{
var accountID = Xrm.Page.getAttribute("productid");
var AccountIDObj= accountID.getValue();
if (AccountIDObj!=null)
{
AccountID= AccountIDObj[0].id;
}
var fetch =
"@<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>
<entity name = 'quotedetail'>
<attribute name = 'productid'/>
<attribute name = 'productdescription'/>
<attribute name = 'priceperunit'/>
<attribute name = 'quantity'/>
<attribute name = 'extendedamount'/>
<attribute name = 'quotedetailid'/>
<link-entity name ='product' alias='bf' to='productid' from='productid'>
<filter type = 'and'>
<condition attribute='productnumber' value ='" + AccountID + "' operator = 'eq'/>
</filter>
<link-entity name='productpricelevel' alias='bg' to='productid' from ='productid'>
<attribute name = 'amount'/>
</link-entity>
</link-entity>
</entity>
</fetch>"
我现在遇到的问题是从这里去哪里,在 C# 中我会用查询创建一个 EntityCollection 并从那里去,有人有什么建议吗?
【问题讨论】:
标签: c# javascript dynamics-crm-2013 fetchxml