I have the following bit of code in my plugin:
string fetchXml =
@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='team'>
<attribute name='name' />
<attribute name='teamid' />
<order attribute='name' descending='false' />
<filter type='and'>
<condition attribute='name' operator='eq' value='All Users' />
</filter>
</entity>
</fetch>";
This is the fetch xml query I'm trying to use to grab a Team named "All Users".
I am executing the request like this:
FetchExpression fetchExpressionXML = new FetchExpression(fetchXml);
EntityCollection Teams;
Teams = service.RetrieveMultiple(fetchExpressionXML);
Note that service is an IOrganizationService object.
This works if I try to pull an account instead of a team. However, with a Team it fails 95% of the time. A non-descript exception error is occurring during service.RetrieveMultiple(fetchEpressionXML). On rare occasion it appears to be work, but this almost never happens.
Does anyone have any insight on what might be the problem? Again, this method works if I'm querying accounts, so there seems to be something special about teams that makes this different.
*This post is locked for comments
I have the same question (0)