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
2
votes
2 answers

Translating LINQ query into CRM QueryExpression while using 'select new'

I've got the following container class: public class AssetAndItsDepositsContainer { public jp_asset Asset { get; set; } public jp_deposit Deposit { get; set; } } Is there a way to take the following LINQ query: from a in…
OfirD
  • 9,442
  • 5
  • 47
  • 90
2
votes
1 answer

Django - Getting value from F expression

I believe this should be quite easy but it presented some challenge and no advice has came up googling. I have a django model like this: Affiliate -> Account where account has a balance attribute which keeps track of the account balance. Since it…
coya
  • 264
  • 2
  • 15
2
votes
3 answers

sql statement that requires 2 distinct

i have a table where there's a user_id and a ticket_type. i want to create a sql statement that will return me the the count of each ticket_type that each user_id generate. i have come up with this but this involves some hard-coding of ticket_type…
user1166085
  • 617
  • 3
  • 12
  • 23
2
votes
1 answer

Grab list of users exists in a relation in dynamics crm

I've many to many relationship in dynamics crm form Order to System users and From following snippet I am trying to grab the list of users that exits in this relationship. But this throw the exception that Additional information: 'SystemUser' entity…
M. Ali
  • 37
  • 6
2
votes
1 answer

How can passing the Entity's logical name on a ConditionExpression for the ObjectTypeCode work?

I have this piece of code: new QueryExpression { EntityName = "systemform", ColumnSet = new ColumnSet("name"), Criteria = { Conditions = { new ConditionExpression("objecttypecode", ConditionOperator.Equal,…
Ryan
  • 90
  • 9
2
votes
1 answer

LINQ query expressions and extension methods

How to make this expression using the methods of exptension, but (!) not using anonymous types? from p in posts join u in context.oxite_Users on p.CreatorUserID equals u.UserID join pa in…
2
votes
1 answer

Why does the order of inner join matter in F# query expression

I am following an example from a book about query expression. I didn't type exactly as what's written in the book and somehow to my surprise the order of sequence matters even for an inner join query in F#. The book didn't mention anything about the…
dragonfly02
  • 3,403
  • 32
  • 55
2
votes
1 answer

MS Access 2007 - Receiving Syntax Error in query expression

MS Access 2007 - Receiving Syntax Error in query expression. Want to delete a record from one table (Parties) using another table's (Export_Extras) field (EmailEfile does not contain Email) delete from Parties where Document_ID in (select…
2
votes
2 answers

How to Add an optionset filter criteria in MS CRM Query Expression?

I have an entity LeaveType with two attributes, 1. Type, 2. Available Days, where Type is an optionset and Available days is a text field. I want to fetch all such LeaveType records where the Type = 'Annual' selected in the optionset. I am not able…
geekstudent
  • 93
  • 1
  • 12
2
votes
2 answers

SQL Server query weird behaviour

I ran into a strange behaviour by a query in SQL Server I have two tables PrepaidTransactions and BillingData and I am executing the following query Select * from PrepaidTransactions where customer_Id in (Select customer_Id …
Mourya
  • 2,360
  • 3
  • 18
  • 24
2
votes
1 answer

QueryExpression with no results in Dynamics CRM plugin

I wrote the following function to get the SharePointDocumentLocation records regarding an account or contact. However, even though I provide an id which most definitely has got a SPDL record associated the result of a count on the EntityCollection…
Martijn Burger
  • 7,315
  • 8
  • 54
  • 94
2
votes
1 answer

Linq Include helper function for f# style pipelining

I want to eagerly load some records from and their relations from the database something like this: let getEmails() = let emails = (query { for q in entities.QueueItems do select q.Email take…
Joe Taylor
  • 2,145
  • 1
  • 19
  • 35
2
votes
3 answers

Writing Native SQL for CRM 2011

I wonder about that can I write native SQL to add or delete operations instead of using Query Expression or FetchXML etc. I know Query Expression is very useful but my real concern is performance and I've thought writing SQL can be faster than the…
1
vote
0 answers

How to use Include in query expression with object initilazation using EF 4.1

I'm using Entity framework 4.1 code first and Here is a simplified version of my domain classes: public class Tour { public string TourName { get; set; } public virtual List Events { get; set; } } public class Event { public…
1
vote
2 answers

How to write QueryExpression for following query?

I am trying to write a plugin in dynamics crm 4.0. following is my fetch query which working fine. I tested on fetchxml Builder. but when I am trying to convert into QueryExpression it is not returing any result.
jk.
  • 83
  • 4
  • 12
1 2 3
8 9