web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

ConditionOperator To FetchXml Operator

Guido Preite Profile Picture Guido Preite 54,086 Moderator

Dynamics CRM SDK contains the ConditionOperator enumerator that can be used when building a QueryExpression, but the SDK doesn't provide a way to convert a ConditionOperator to its FetchXml equivalent.

I created a static method that accepts a ConditionOperator enumerator and returns a string containing the equivalent FetchXml operator:

public static string ConditionOperatorToFetchXmlOperator(ConditionOperator conditionOperator)


string fetchXmlOperator = ConditionOperatorToFetchXmlOperator(ConditionOperator.EqualUserId);
// fetchXmlOperator will be "eq-userid"

The library can be downloaded from Technet Gallery:
https://gallery.technet.microsoft.com/scriptcenter/ConditionOperator-To-065c445e

Note: the library contains the ConditionOperator for CRM 2011, CRM 2013 and CRM 2015.


This was originally posted here.

Comments

*This post is locked for comments