其他信息:
当我尝试使用fetchxml Builder检索“日历规则”时,出现错误提示
不支持提取多个
使用CRMRESTBuilder“日历规则”实体不可用。 使用Data Transporter,它没有传输记录,也没有将错误抛为
“不支持检索多个”
以下链接对于了解日历及其所有相关实体非常有用。 https://www.inogic.com/blog/2014/08/calendars-and-expand-calendar-request-in-crm-2013-sp-1/
答案 0 :(得分:1)
可以使用XrmToolbox的FetchXml Tester检索CalendarRule实体,这表明它支持ExecuteFetchRequest,但不支持RetrieveMultiple。
我在当天的CRM技巧文章中写了一篇有关表现出这种行为的实体的文章:https://crmtipoftheday.com/796/long-live-executefetchrequest/
查询:
<fetch>
<entity name="calendarrule" />
</fetch>
响应(第一条记录):
<result>
<groupdesignator>
FC5769FC-4DE9-445d-8F4E-6E9869E60857
</groupdesignator>
<rank formattedvalue="2" >
2
</rank>
<createdon date="4/11/2019" time="8:55 PM" >
2019-04-11T20:55:16-04:00
</createdon>
<starttime date="12/31/1999" time="7:00 PM" >
1999-12-31T19:00:00-05:00
</starttime>
<organizationid>
{3906F615-4DCD-422D-A3E3-F79134C7CCEF}
</organizationid>
<isselected name="Yes" >
1
</isselected>
<duration formattedvalue="1,440" >
1440
</duration>
<innercalendarid type="4003" >
{7177F09C-BD5C-E911-A817-000D3A37FFD3}
</innercalendarid>
<isvaried name="No" >
0
</isvaried>
<modifiedon date="4/11/2019" time="8:55 PM" >
2019-04-11T20:55:16-04:00
</modifiedon>
<createdby name="--- ---" dsc="" yomi="--- ---" type="8" >
{EE10412E-68E7-471D-A10C-D28FCE63B6F3}
</createdby>
<calendarruleid>
{7277F09C-BD5C-E911-A817-000D3A37FFD3}
</calendarruleid>
<timezonecode formattedvalue="92" >
92
</timezonecode>
<pattern>
FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
</pattern>
<description>
Weekly Single Rule
</description>
<modifiedby name="--- ---" dsc="" yomi="--- ---" type="8" >
{EE10412E-68E7-471D-A10C-D28FCE63B6F3}
</modifiedby>
<calendarid type="4003" >
{7077F09C-BD5C-E911-A817-000D3A37FFD3}
</calendarid>
<effectiveintervalend date="12/30/9999" time="6:59 PM" >
9999-12-30T18:59:59-05:00
</effectiveintervalend>
<businessunitid>
{79263477-AA5C-E911-A817-000D3A37FFD3}
</businessunitid>
</result>
这是一些示例C#代码(未经当前测试):
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Tooling.Connector;
public void Run()
{
var connectionString = "Url=https://foobar.crm.dynamics.com; Username=user@foobar.onmicrosoft.com; Password=myPass; AuthType=Office365";
var crmSvcClient = new CrmServiceClient(connectionString);
var fetch = @"<fetch mapping='logical'>
<entity name='calendarrule' />
</fetch>";
var executeFetchReq = new ExecuteFetchRequest
{
FetchXml = fetch
};
//Works
var crmSvcExecuteFetchResponse = crmSvcClient.Execute(executeFetchReq);
//Doesn't work
var crmSvcRetrieveMultipleResponse = crmSvcClient.RetrieveMultiple(new FetchExpression(fetch));
}