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
3
votes
0 answers

Query expression with join on multi part key and nullables

Consider the following two tables, with 3 columns each: Table 1: a INTEGER NOT NULL, b INTEGER NOT NULL, c INTEGER NOT NULL Table 2: d INTEGER NOT NULL, e INTEGER, f INTEGER NOT NULL I'm trying to write a query expression that joins the two tables…
siki
  • 9,077
  • 3
  • 27
  • 36
3
votes
1 answer

How to create ConditionExpression for QueryExpression on statecode in early bound?

In late bound I'd use something like this to add a condition for only getting active records. new ConditionExpression { AttributeName = "statecode", Operator = ConditionOperator.NotEqual, Values = { SomeClass.Active } } But how do I express…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
3
votes
2 answers

Query expressions vs Lambda expressions

What is the point of using query expressions instead of lambda expressions? It not only slower it even more verbose (see here): Example (from above link): QE: var products = from p in northwind.Products where p.Category.CategoryName == "Beverages"…
biox
  • 1,526
  • 5
  • 17
  • 28
3
votes
0 answers

sift.js(MongoDB inspired array filtering library) PHP port

There's a sift.js library, which allows you to use MongoDB syntax to query JavaScript arrays. I've asked for a such PHP class in my question, and got several answers so far with good examples, but they still have some compatibility and performance…
fitheflow
  • 411
  • 3
  • 12
3
votes
3 answers

What should be used instead of the deprecated EntityName.account.ToString()?

When I design a QueryExpression, I've always used the following, hard-coded syntax. QueryExpression expression = new QueryExpression { EntityName = "account"; ... } In this blog the following syntax based on this enumeration is…
user1675891
3
votes
2 answers

Case insensitive QueryExpression

Is it possible to build a query with a ConditionExpression which is not case sensitive ? ConditionExpression condition = new ConditionExpression() { AttributeName = "lastname", Operator = ConditionOperator.BeginsWith, Values = new…
2
votes
4 answers

CRM 2011 KeyNotFoundException exception

I am new to CRM development. I have a Custom Entity "customer". This Entity has a Field called "defaultcustomer", which can be TRUE or FALSE. I am working on a Plug-In where i need to set the "defaultcustomer" to FALSE for all the "Customers". I am…
Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149
2
votes
1 answer

Multiplying an integer and a decimal in a Django model using model expressions

I am a Django beginner and in one of my projects, I made this model: class Piece(models.Model): order = models.ForeignKey(Order,on_delete=models.CASCADE) coil = models.ForeignKey(Cut_Material ,on_delete=models.CASCADE) piece_length…
Sents
  • 21
  • 4
2
votes
4 answers

Django query expression for counting particular attendance

I have a field that has 1000 rows. In these rows there are 2 status available. Present and Absent. I want to know if there's a query expression to count the total number of students present or absent from the Attendence field so that i can store the…
2
votes
2 answers

MS CRM QueryExpression ConditionExpression w/ CRMBoolean type

I'm using Microsoft's CRM software (4.0) and I'm trying to build a query expression. It works fine with querying only String values, but now I need to include a field that is of type CRMBoolean. I should also mention I'm querying custom entities.…
lhan
  • 4,585
  • 11
  • 60
  • 105
2
votes
2 answers

On PREM Dynamics CRM 2016 JavaScript equivalent of my C# QueryExpression

I am trying to get the FetchXML query for a specific query expression fro Dynamics CRM. I have manged to do it using the XRM SDK in a C# project as follows. string connectionStr =…
2
votes
2 answers

CRM Online RetrieveMultiple with OptionSetValueCollection condition

I'm trying to retrieve records that contain some optionsetvalue from multi option set pick list. This line make my code fail: int[] values = GetValues(); query.Criteria.AddCondition(new ConditionExpression(fieldName,…
Moran Barzilay
  • 133
  • 2
  • 13
2
votes
2 answers

dynamics crm 365 plugin apply QueryExpression to custom list of entities

In my plugin, I have a list of entities. I would like to apply the query expression that is passed in the input parameters QueryExpression query = PluginExecutionContext.InputParameters["Query"]; to a custom list of type entity. List
noobie
  • 2,427
  • 5
  • 41
  • 66
2
votes
1 answer

Why does intellisense fail on my F# script?

I've been building a library to interact with one of my databases at work and everything is working fine. But when I open a new script and begin to use the library, it always freaks out when I try to use query expressions on the database. They work…
jks612
  • 1,224
  • 1
  • 11
  • 20
2
votes
2 answers

Retrieve top one record from CRM using early bound

I want to retrieve top most record from my CRM entity using early bound query expression. I have written it as: QueryExpression opportunityProductsQuery = new QueryExpression { EntityName =…
omkar patade
  • 1,442
  • 9
  • 34
  • 66
1 2
3
8 9