Tag Info

New answers tagged

0

Try this Query CAMLQuery: "<Query><Where><Eq><FieldRef Name='school_x0020_id'/><Value Type='Text'>4440</Value></Eq></Where></Query>",


0

I see a couple things, eq should be Eq is school id the name of your column? Make sure the casing is correct. Lookup values should be represented like: <Eq> <FieldRef Name='RelatedIssues' LookupId='True' /> <Value Type='Lookup'>4440</Value> </Eq> Also look at the Biwug CAML Designer for all your CAML querying needs.


0

Try changing your <eq> </eq> tags to <Eq> </Eq> I think case matters for those tags.


0

I have come up with a solution! On the page, I place two web parts: WP1 - XsltListViewWebPart shows the 'flat' view of the Document Library which contains the document sets. So it would show ALL* files within the doc lib, which satisfy a Query within the view, which basically says "give me all documents which contain the {Param} folder in their folder ...


0

There's a couple of of posts here and here but I've added support for the <In> query if more than one value for the same field is specified (hence why I don't use a Dictionary pair). My code currently only supports Text fields and doesn't support <Or>. Others have mentioned the REST API as an alternative approach. Code - you can run this in ...


0

Here's a Linq way. I'm demonstrating the return of a single item: SPList nums = web.Lists.TryGetList("Some List"); var filtered = nums.Items.Cast<SPListItem>().FirstOrDefault(k => k["Content Type Name"].ToString().Equals(key)); if (filtered != null) { //do whatever you want to the returned item(s) filtered["Some Field"] = MyValue; ...


0

You can use the property defaultView: "month". This will display the calendar in Month View. Take a look at http://joshmccarty.com/2011/11/sharepoint-jquery-and-fullcalendar%E2%80%94now-with-spservices/ For changing month, first you need to calculate the start. Then you can use that value in camlQuery and camlOptions.


0

Couple of things. You need to handle OnSorting event and manually sort the DataTable. Then put the datatable back into ViewState You should use DisplayName Pseudo Code protected void grdProtocolli_Sorting(object sender, GridViewSortEventArgs e) { string sortingDirection = //LOGIC TO SET DIRECTION //direction is the public property if ...


0

I think you have mentioned exact similar question with similar CAML query here at SharePoint Stack Exchange. Refer below updated query from U2U builder <View> <Query> <Where> <And> <Neq> <FieldRef Name="ID" /> <Value Type="Number">0</Value> </Neq> ...


0

I have used CAML query builder to re create your query. I hope this works!! I suspect the AND clause were not properly placed. <View> <Query> <Where> <And> <Neq> <FieldRef Name="ID" /> <Value Type="Number">0</Value> </Neq> ...


0

I have edited your caml query but i have not tested it. Try this caml query. If issue occurs please let me know. <View><Query> <Where> <And> <And> <And> <Neq><FieldRef Name="ID" /><Value Type="Number">0</Value></Neq> ...


0

You can impersonate only using server side code. So either provide read access or create a custom web part for displaying data.


2

You could sort list items using array.sort function: function getListItems(listTitle,success,error) { var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); var items = list.getItems(SP.CamlQuery.createAllItemsQuery()); ctx.load(items); ctx.executeQueryAsync(function() { success(items); ...


0

Could you use linq?: SPList objRelationShipList; SPListItemCollection objRelationShipListItems; objRelationShipList = SPContext.Current.Web.Lists["ListName"]; objRelationShipListItems = objRelationShipList.Items; List<SPListItem> results = (from SPListItem item in objRelationShipListItems orderby item.ID ...


1

You can use the Order By in CAML: <OrderBy> <FieldRef Name = "ID" Ascending = "TRUE"/> </OrderBy> <Where> ... </Where>


0

Check if a ListItem exists using CAML SPQuery spQuery = new SPQuery(); spQuery.Query = @"<Where><Eq><FieldRef Name='Year' /><Value Type='Text'>2014</Value></Eq></Where>"; if (list.GetItems(spQuery).Count == 0) { SPListItem item = list.Items.Add(); item["Year"] = "2014"; item.Update(); } Check if a ...


0

This has something to do with your SPQuery and if you pass an invalid one. When SharePoint parse the XML and detected it is invalid it passes instead of your default query a CAML Query that looks like this. <Query> <Where> <Neq> <FieldRef Name='ID' /> <Value Type='Integer'>-1</Value> ...


1

Your code looks like you are using server object model using c#. I have faced issues using CAML queries. My queries were not able to pull data, But after removing <Query></Query> tag I was able to solve the problem. So based on my past experience I can propose you following improvements and try the below code. Query query = new SPQuery(); ...


1

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use: SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" To specify the row limit use: query.RowLimit = 100; To ...



Top 50 recent answers are included