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
0
votes
1 answer

Dynamics CRM QueryExpression

I have this query that populates a joborder with the notes (2 different types) that comes from the account on the job order. The problem that I'm having is that it works on most of the job orders but there are some that I'm noticing that the notes…
amberl
  • 81
  • 1
  • 17
0
votes
0 answers

Lambda Scope for query expressions

This code works: gErrorHandler.Push("frmItemcodes.cmdRunMethodOne_Click") If gfHANDEL_ERRORS Then On Error GoTo PROC_ERR Dim query = KQdbs.Items.Where(Function(f) f.Itemcode > 8000) Me.dgvItemcodes.DataSource = query.ToList PROC_EXIT: …
0
votes
1 answer

Specified Cast Invalid

I am trying to retrospectively write some unit tests for code I inherited. One particular method is causing me problems within a Dynamics CRM 2011 plugin method with a LinkedEntity FilterCondition in a QueryExpression Structure of Entities Contact…
Mauro
  • 4,531
  • 3
  • 30
  • 56
0
votes
1 answer

how to replace blank or null value with default value(ie 0 or "NA") in column in QueryExpression in crm

i want make query expression in which one column contain values or it will be blank or null according to condition. Example - contact entity firstName | LastName | Address1 name1 | lastname1 | name2 | lastname2 | address name3 | …
0
votes
1 answer

how to modify query expression for flexible results - Win Forms C#

Introduction I am working with winforms.The query expression i have created to search on user input, return results correctly. Query Expression public static readonly string SqlSearchPlotByName = "Select " + " PropertyId, Contact, Location, Street,…
Suhail Mumtaz Awan
  • 3,295
  • 8
  • 43
  • 77
0
votes
1 answer

convert my sql query to queryexpression or fetchxml in crm

I have this SQL query where I am trying to fetch the opportunityId from opportunity entity for whom approvaldocument has not been created (approval document is the name of the other entity) .I dont think fetchxml supports such kind of query. I am…
0
votes
1 answer

Expression not working in a child group

I have made a report that has a parent group fully working with expression. I have also for a child group that is visible once selected the toggle. But I'm struggle to get the expression working in the child group when the parent works fine .…
user5627259
0
votes
0 answers

How to use "Distinct" in query expression for Entity object

I am writing a query to a entity object, is it possible to use distinct on a column ? below is my query query = From r In objEntity.W_PDD Join p In objEntity.W_PER On r.PER_NO Equals p.PER_NO Where…
RookieRoll
  • 175
  • 1
  • 1
  • 16
0
votes
1 answer

Microsoft CRM QueryExpression in C#

i have code like below: QueryExpression query = new QueryExpression(); query.EntityName = "new_callistyorder"; ColumnSet col = new ColumnSet("new_nomororder","new_customer"); query.ColumnSet = col; …
Fikri Hailal
  • 123
  • 2
  • 4
  • 16
0
votes
2 answers

DBNull exception in query expression

I have this query expression, to concatenate some values for data validation result.AddRange(from string dr in ercDt select dc.Ordinal.ToString() + "|" + dr); Having that ercDt[0] is DBNull, and has no more rows, i'm getting this error Unable…
culebrin
  • 125
  • 1
  • 15
0
votes
1 answer

how to format phone numbers in crm 2013 plugin using QueryExpression

i'm developing a plugin (asp page) who should get as parameter Phone Number and retrieve the matched client in CRM 2013. the phone number is clean from punctuation marks and spaces for example: PhoneNum = Replace(PhoneNum, "-", "") Dim query As New…
0
votes
1 answer

Receiving Error in Workflow activity code

I am receiving the following error in my code: Condition for attribute 'sgfdhr_leavetype.new_employeeleavecalculation': expected argument(s) of type 'System.Guid' but received 'Microsoft.Xrm.Sdk.EntityReference'. My code is below: public int…
0
votes
1 answer

Access to foreach variable in closure shows warning about compiler, but doesn't show warning in query expression syntax

For comment below, here's some setup code: var allItems = new List(); allItems.Add(new Item{Id = 1});//etc etc allItems.Add(new Item{Id = 2, ParentId = 1});//etc etc Given the setup code; the following code: foreach (var parentItem in…
lanierhall
  • 530
  • 1
  • 5
  • 15
0
votes
0 answers

"The collection was unreferenced" .Hibernate filter on an entity list by a column name?

Im getting this Prescription List from mysql db and what I want to do is , to filter the list by patient_id and get the filtered list. I'm getting the prescriptions list finely.But I'm unable to get the filterList. Following is my code. @Override …
Amila Iddamalgoda
  • 4,166
  • 11
  • 46
  • 85
0
votes
1 answer

Error occurred when verifying security for the message in CRM On-line

I'm moving out some of the code from a plugin to an external web application. The only thing that needs to be added is the authorization. When executing my QueryExpression instance from within the plugin, that's not an issue. However, accessing the…
1 2 3
8
9