Dynamics crm 2011 系统如何解析fetchXML日期运算符

Dynamics crm 2011 系统如何解析fetchXML日期运算符,dynamics-crm-2011,dynamics-crm,Dynamics Crm 2011,Dynamics Crm,CRM 2013内部部署 你好, 我已经为项目编写了一个基本视图,其开始日期为接下来的七天,由以下fetchXML定义: <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" > <entity name="xxxx_project" > <attribute name="xxxx_startdate" /> <attr

CRM 2013内部部署

你好,

我已经为项目编写了一个基本视图,其开始日期为接下来的七天,由以下fetchXML定义:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
  <entity name="xxxx_project" >
    <attribute name="xxxx_startdate" />
    <attribute name="xxxx_accountid" />
    <attribute name="xxxx_produom" />
    <order attribute="xxxx_name" descending="false" />
    <filter type="and" >
        <filter type="and" >
            <condition attribute="statecode" operator="eq" value="0" />
            <condition attribute="xxxx_projectstatus" operator="eq" value="331420009" />
            <condition attribute="xxxx_materialsshipdate" operator="null" />
            <condition attribute="xxxx_startdate" operator="next-x-days" value="7" />
        </filter>
    </filter>
    <attribute name="xxxx_projectid" />
  </entity>
</fetch>

但我不知道那应该是什么样子

我问这个问题的原因是,我想使用这个基本的fetchXML作为模板,但要插入我选择的日期


有什么想法吗?

如果您想根据日期动态构建fetchXML,模拟未来7天的条件,您可以随时使用on或Before和on或After条件重写它。 比如说

<condition attribute="xxxx_startdate" operator="on-or-after" value="2014-04-23" />
<condition attribute="xxxx_startdate" operator="on-or-before" value=2014-04-30" />


啊好的。那么,您知道Msoft在幕后使用Next X days操作符是否就是这么做的吗?在运行时,fetchxml被转换为查询数据库(在SQL中有不同的方法来实现这一点)好的,当然……但是如果它被转换为T-SQL,为什么不允许T-SQL,或者至少对大多数T-SQL操作使用fetch等价物呢?我知道这是一个可能需要水晶球才能回答的问题。--我刚刚完成了你的原始答案,并生成了完美的视图,太棒了!
<condition attribute="xxxx_startdate" operator="next-7-days" value="2014-04-23" />
<condition attribute="xxxx_startdate" operator="on-or-after" value="2014-04-23" />
<condition attribute="xxxx_startdate" operator="on-or-before" value=2014-04-30" />