Sql FetchXML nvarchar不返回任何内容-CRM的自定义报告

Sql FetchXML nvarchar不返回任何内容-CRM的自定义报告,sql,dynamics-crm,nvarchar,fetchxml,Sql,Dynamics Crm,Nvarchar,Fetchxml,我正在尝试使用FetchXML从Dynamics CRM 2013获取定制报告的数据 我使用此页面将以下SQL查询“转换”为FetchXML: SQL: 获取XML: <fetch mapping="logical"> <entity name="invoice"> <attribute name="accountidname" /> <attribute name="billto_line1" /> <attri

我正在尝试使用FetchXML从Dynamics CRM 2013获取定制报告的数据

我使用此页面将以下SQL查询“转换”为FetchXML:

SQL:

获取XML:

<fetch mapping="logical">
  <entity name="invoice">
    <attribute name="accountidname" />
    <attribute name="billto_line1" />
    <attribute name="billto_postalcode" />
    <attribute name="billto_city" />
    <attribute name="invoicenumber" />
    <attribute name="name" />
    <attribute name="description" />
    <filter>
      <condition attribute="invoiceid" operator="eq" value="@invoiceid" />
    </filter>
  </entity>
</fetch>

“accountidname”和(例如)“billto_line1”都是NVARCHAR(4000)并且都包含数据,但是如果我尝试执行查询(例如在Visual Studio中的“查询设计器”中),则只显示“billto_line1”的数据,而不是“accountidname”的数据

由于“accountidname”和“billto_line1”两个字段的类型相同(nvarchar(4000))并且在数据库中包含信息(我与“Microsoft SQL Server Management Studio”进行了检查),我想知道为什么我只能从这两个字段中的一个接收信息

很多不同的NVARCHAR类型的字段都出现了这种情况——有些显示正确,有些则不正确——我不知道为什么

如果有人能给我一个提示,我会非常高兴:)


谢谢

accountidname
在SQL中的视图中,而不是实际的表中。它不是
发票
实体上的字段,因此不会在FetchXml请求中返回任何信息

您应该能够使用
accountid
检索帐户名称-我不记得在SSRS中
EntityReference
name
属性是如何出现的,但它应该是可用的


FetchXml转换器擅长将SQL SELECT转换为FetchXml格式并转换联接。它不会验证SQL字段是否在FetchXml中可用-这只能通过访问CRM组织的元数据来完成。

感谢您的快速响应(很抱歉我的延迟重播-我离开办公室几天)。你的解释很有道理,而且自从我开始访问实际的表(不仅仅是视图)以来,一切似乎都很好。谢谢-你让我(和我的老板)很高兴:)
<fetch mapping="logical">
  <entity name="invoice">
    <attribute name="accountidname" />
    <attribute name="billto_line1" />
    <attribute name="billto_postalcode" />
    <attribute name="billto_city" />
    <attribute name="invoicenumber" />
    <attribute name="name" />
    <attribute name="description" />
    <filter>
      <condition attribute="invoiceid" operator="eq" value="@invoiceid" />
    </filter>
  </entity>
</fetch>