【发布时间】:2026-02-10 18:30:01
【问题描述】:
当尝试使用 fetchxml 和 group by 进行分页时 总是 pagecookies 返回空字符串和更多记录返回 false
string fetchXml = @"
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' aggregate='true'>
<entity name='appointment'>
<all-attributes />
<attribute name='shiftstart' alias='shiftstartyear' groupby='true' dategrouping='year' />
<attribute name='shiftstart' alias='shiftstartmonth' groupby='true' dategrouping='month' />
<attribute name='shiftstart' alias='shiftstartday' groupby='true' dategrouping='day' />
<attribute name='contId' alias='contId' groupby='true' />
<filter type='and'>
<condition attribute ='status' operator='not-in'><value>2</value><value>3</value>
</condition>
<condition attribute ='contact' operator='eq' value ='" + contactId + @"' />
</filter>
</entity>
</fetch>";
string xml = CreateXml(fetchXml, PageCookies, pagenumber, pageSize);
// Excute the fetch query and get the xml result.
RetrieveMultipleRequest fetchRequest1 = new RetrieveMultipleRequest
{
Query = new FetchExpression(xml)
};
var returnCollection = ((RetrieveMultipleResponse)GlobalCode.Service.Execute(fetchRequest1)).EntityCollection;
【问题讨论】:
-
这个问题不完整吗?我看不到你在哪里使用
PageCookies、pagenumber或pageSize
标签: c# dynamics-crm dynamics-crm-2016 fetchxml