Hot answers tagged

7

If you want to compare with both conditions than use AND: @"<Where> <And> <Eq> <FieldRef Name='ReportsTo' /> <Value Type='Text'>" + reportsTo + @"</Value> </Eq> <Eq> <FieldRef Name='Team' /> <Value Type='Text'>"+ selected+ @"</Value> </Eq> </And> </...


3

operation: "GetListItems", async: false, listName: "Marketing Requests", viewName: "54E61A50-B5A9-4D59-91B9-EA9D280B8C24", CAMLRowLimit: 5000, CAMLQuery: "<Query><Where><Eq><FieldRef Name='Assign_x0020_To'/><Value Type='User' >" + selectedDesignerOpenProjs + "</Value></Eq></Where></Query>", completefunc: ...


2

In CAML Query you should use field internal name instead of Display Name. You can get the internal name for a column by browsing to the List Settings > Edit Column and look at the QueryString value Field.


2

queryMuaj.Query = "<OrderBy>" + "<FieldRef Name ='testb' Ascending = 'TRUE'/>" + "</OrderBy>" + "<Where>" + "<And>"+ "<And>" + "<Geq>" + "<...


2

Can you try putting <RowLimit>1</RowLimit> in the Query. The row limit will return only the one last item.


2

Here string myEndMil = myItemCol[0]["endMil"].ToString(); you are assuming you have gotten at least one result back. That might not be the case! You should check first that myItemCol.Count > 0 There is another possible issue at the same line (string myEndMil = myItemCol[0]["endMil"].ToString();) You are requesting a column endMil that you might not ...


1

You can try DateTime enddate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day); DateTime startDate = enddate.AddDays(-7); query.Query = "<Where>" + "<And>" + "<Eq><FieldRef Name='Kompania' /><Value Type='Text'>" + ...


1

Try this query: <OrderBy> <FieldRef Name ='testb' Ascending = 'TRUE'/> </OrderBy> <Where> <And> <Eq><FieldRef Name='Team' /><Value Type='Text'>" + selvalcomp+ "</Value></Eq> <And> <Geq><FieldRef Name='testb' /><Value Type='DateTime' IncludeTimeValue='FALSE'&...


1

Try this code. Added some safe checks void ddCarNumber_TextChanged(object sender, EventArgs e) { try { SPWeb myWEB = SPContext.Current.Web; SPList myList = myWEB.Lists.TryGetList("WayBill"); if(myList != null) { SPQuery myQuery = new SPQuery(); myQuery.Query = @"<OrderBy> ...


1

Try this below method: void ddCarNumber_TextChanged(object sender, EventArgs e) { try { SPWeb myWEB = SPContext.Current.Web; SPList myList = myWEB.Lists["WayBill"]; SPQuery myQuery = new SPQuery(); myQuery.Query = "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><Where><Eq&...


1

@"<Where> <And> <Eq><FieldRef Name='ReportsTo' /><Value Type='Text'>" + reportsTo + @"</Value></Eq> <Eq><FieldRef Name='Team' /><Value Type='Text'>"+ selected+ @"</Value></Eq> </And> </Where>"


1

You can use like this: @"<Where> <And> <Eq> <FieldRef Name='ReportsTo' /> <Value Type='Text'>" + reportsTo + @"</Value> </Eq> <Eq> <FieldRef Name='Team' /> <Value Type='Text'>"+ selected+ @"</Value> </Eq> </And> </Where>" NOTE: You can also use <...


1

Wrap your conditions in <And>...</And> inside <Where> Reference: https://msdn.microsoft.com/en-us/library/office/ms196939.aspx @"<Where> <And> <Eq> <FieldRef Name='ReportsTo' /> <Value Type='Text'>" + reportsTo + @"</Value> </Eq> <Eq> &...



Only top voted, non community-wiki answers of a minimum length are eligible