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 :
Microsoft Dynamics CRM (Archived)

How to use multiple 'Like' operator in Query Expression ?

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

Requirement is to filter system views based on security role. In which i am using below query expression to filter the system views. I was able to use only one like operator.

Code:

ConditionExpression queryCondition = new ConditionExpression("name", ConditionOperator.Like, "My %");
qe.Criteria.Conditions.Add(queryCondition);

Where i need system view that starts with "My" and "Team"... please help me to do it.

Thanks,

Vignesh Mohan

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    The following should help you out:

               QueryExpression query = new QueryExpression

               {

                   EntityName = entityName,

                   ColumnSet = new ColumnSet(true),

                   Criteria = new FilterExpression(LogicalOperator.Or)

                   {

                       Conditions =

                       {

                           new ConditionExpression("name", ConditionOperator.Like, "My%"),

                           new ConditionExpression("name", ConditionOperator.Like, "Team%")

                       }

                   }

               };

    Basically, set the Criteria Filter Expression with Logical Operator "OR"

    Hope this helps.

  • EmployeeOcta Profile Picture
    6 on at

    Go through below link.

    msdn.microsoft.com/.../gg309410.aspx

    and modify your needs accordingly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans