Questions tagged [query-expressions]

Use for assistance when dealing with Microsoft Dynamics CRM QueryExpression objects and their use.

Query expressions are used in methods that retrieve more than one record, such as the IOrganizationService.RetrieveMultiple method, in messages that perform an operation on a result set specified by a query expression, such as BulkDeleteRequest and when the ID for a specific record is not known.

Useful Links:

  1. Build queries with QueryExpression
  2. Code sample
126 questions
4
votes
3 answers

F# Query Expression using join & groupBy in same query

I decided to learn how to use query expressions in F# and found the official Microsoft documentation. The caveats don't seem spelled out so I'm sure I've hit a problem with a simple fix but don't know why I'm getting the error it shows. My thought…
jks612
  • 1,224
  • 1
  • 11
  • 20
4
votes
1 answer

Dynamics CRM Query Expression filter or condition against two linked entities

I am currently trying to retrieve all the system users that are either assigned to a specific security role or are assigned to a team which has the security role. when building the query it seems only to filter them by an and condition when writing…
Brad Sturgess
  • 151
  • 1
  • 10
4
votes
2 answers

How can I use condition and filters in LinkEntity?

I want to create a QueryExpression to simulate this SQL statement select * from A inner join B on A.b_id=B.ID where B.Name like "% what ever %" this is how the FetchXML might look like
Opt Prutal
  • 384
  • 4
  • 14
4
votes
2 answers

F# query expressions yield

I am learning F# and now am reading about computation expressions and query expressions to use with SQL type providers. I was doing some simple tasks and at some point needed to concatenate (Union) 2 queries, my first thought, after reading about…
Luiso
  • 4,173
  • 2
  • 37
  • 60
4
votes
1 answer

How to recognize non-human users?

Listing all the users in the system, I noticed that some of them were system users and didn't have e.g. working hours at all. At the moment, I just list them and exclude from my loop my it's a Q&D approach and I prefer to do it right. I haven't…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
4
votes
3 answers

CRM ConditionExpression to compare two attributes

I'm using Microsoft CRM SDK to retrieve entities. I'm writing QueryExpression with FilterExpression. How to write a condition, that takes two attributes in consideration? I want to retrieve entities, for which attribute "Export Date" is less than…
Tschareck
  • 4,071
  • 9
  • 47
  • 74
4
votes
1 answer

IQueryable lambda style in F#

Is it possible to use lambda-style querying of IQueryable objects in F#, instead of query expressions? Something like: type schema = SqlDataConnection<"Data Source=(local);Initial Catalog=MyDatabase;Integrated Security=true;"> let db =…
user826840
  • 1,233
  • 2
  • 13
  • 28
4
votes
4 answers

How to preform a relative complement query in CRM?

Background (ie what the heck is a relative complement?) Relative Complement What I'm trying to do Let's say I've got a custom Vehicle entity that has a VehicleType option set that is either "Car", or "Truck". There is a 1 to many relationship…
Daryl
  • 18,592
  • 9
  • 78
  • 145
3
votes
2 answers

MS Dynamics - QueryExpression with ConditionOperator.In result in no result but works with ConditionOperator.Equal

I'm trying to make a query in order to retrieve all record containing one of the text in a string list. QueryExpression query = new QueryExpression("account") { ColumnSet = new ColumnSet("primarycontactid",…
3
votes
3 answers

Unable to fetch Not Shared records

I have a scenario, to find the records which are not shared with access team. QueryExpression query = new QueryExpression("task") { ColumnSet = new ColumnSet("activityid", "subject", "customid"), Criteria = new…
Nachiket
  • 620
  • 6
  • 23
3
votes
5 answers

How to use filter on link entity?

I'm using crm 2016 and trying to get a product (custom entity) records according to linkentity filtering, I need to get all products that have Active productstatus and the linked phonecall category is fun and not open: PRODUCT - (productstatus =…
Damkulul
  • 1,406
  • 2
  • 25
  • 59
3
votes
1 answer

F# Query Expressions: cannot use "for"!

For whatever reason, I cannot use a "for" construct within a query expression. What I get is the following error. The code I just what I picked that used to work --> "error: This control construct may only be used if the computation expression…
Sasha Babaei
  • 455
  • 3
  • 8
3
votes
2 answers

When to specify PagingInfo.PagingCookie and PagingInfo.PageNumber

Though reading lots of available resources online, I couldn't find a straight explanation that clarifies: In what case both the values of PageingInfo.PageNumber and PageingInfo.PagingCookie are required to be assigned? For example: Consider we have…
OfirD
  • 9,442
  • 5
  • 47
  • 90
3
votes
3 answers

help with a two table linq query

I want to display categories and subcategories like so: Category 1 Subcategory 1 Subcategory 2 Subcategory 3 Category 2 Subcategory 5 Subcategory 6 Subcategory 7 In other words, foreach category, display the subcategories that belong to…
The Muffin Man
  • 19,585
  • 30
  • 119
  • 191
3
votes
2 answers

order of operators in F# query expression

Does the order of query expression operators matter? Idk, but sometimes (in some selections) it does, but sometimes it doesn't (or maybe it does but implicitly handles some particular occasions). Is is mandatory that select operator must go last? in…
Giorgi Tsiklauri
  • 9,715
  • 8
  • 45
  • 66
1
2
3
8 9