Tag Info

New answers tagged

2

Try this query, I've fixed FieldRef tag <View Scope="RecursiveAll"> <Query> <Where> <Eq> <FieldRef Name="UniqueId" /> <Value Type="Guid">37cf076c-32f9-4ea4-9ed7-04fea659d0f2</Value> </Eq> </Where> </Query> </View> Also I would recommend to use tools ...


1

I would use SPWeb.GetFile('GUID').Item instead. If you know the ID I see no reason to do the CAML query. Edit For SP Online (Client object model) you can use: Web.GetFileById as described here


1

You could just use SP.CamlQuery.createAllItemsQuery() as the parameter for getItems() although simply setting the scope to 'RecursiveAll' and inserting the filter that wjervis suggests should also do the trick. Example of my proposal: list.getItems(SP.CamlQuery.createAllItemsQuery()); You can inspect exactly what this does in your browser dev tools if ...


0

You can use SPQueryThrottlingOption API for achieving the thing that you needed. If number of items in list > its threshold limit, then even fetching some items like 10 or 100 from list will not give you result. Because it first sort all of items present in list then will return top 10 or 100 items. To overcome this part, you can either increase throttling ...


0

Instead of if (thisList.Items.Count > 0) returnTable = thisList.Items.GetDataTable(); Use below code: SPQuery query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name=\"Enable\" /><Value Type=\"Boolean\">1</Value></Eq></Where>"; SPListItemCollection itemCol = list.GetItems(query); var ...


1

public static DataTable GetListData() { DataTable returnTable = null; SPSite thisSite = null; SPWeb thisWeb = null; SPList thisList = null; try { thisSite = new SPSite(siteLink); thisWeb = thisSite.OpenWeb(); thisList = thisWeb.Lists["Resources"]; SPQuery ...


1

Collabion supports Web Part Connections, so you can filter data based on the query string. You'll need to use the Query String filter web part and connect it to Collabion Charts, it's fairly simple. see their docs for more info. Nevron, has something similar too. Hope this helps.


0

Part of the query you list includes: ReviewDate <= today AND ReviewDate > tomorrow I don't think these conditions can be simultaneously satisfied.


5

You can use Membership element: <Or> <Membership Type=\"CurrentUserGroups\"> <FieldRef Name=\"AssignedTo\"/> </Membership> <Eq> <FieldRef Name=\"CurrentReviewer\"></FieldRef> <Value Type=\"Integer\"> <UserID/> </Value> </Eq> </Or> ...


0

What I ended up doing was to create additional calculated column that returns either "yes" or "no" values. In your case the formula would be similar to: =IF([Year]>=TEXT(YEAR([Today])-3,"0"),"Yes","No") In order to be able to use [Today] in the formula you need to create a single line of text field called "Today". After your calculated column is ...


1

Sorry, I think it's not possible. All Query Schema here: http://msdn.microsoft.com/en-us/library/office/ms467521(v=office.15).aspx You can dynamically generate big caml query with https://camlex.codeplex.com/ or https://camljs.codeplex.com/


0

I'd say LINQ to SharePoint is the way to go, but you can also try this: var query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name='field' /><Value Type='Text'>value</Value></Eq> </Where><OrderBy><FieldRef Name='Title' Ascending='true' /></OrderBy>"; var position = new ...


0

You can use the below code for DateTime field formatting for results you get through CAML Query: DateTime dtDate = Convert.ToDateTime(list["DateTimeField"]); spnDate.InnerText = dtDate.ToString("dd-MMMM"); DateTime Formatting reference link in c# : http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx


1

I wrote <Value Type=\"DateTime\" IncludeTimeValue=\"True\">Today</Value> instead of <Value Type=\"DateTime\" IncludeTimeValue=\"True\"><Today /></Value>


0

You had an extra <And> and </And>. Just remember that you only need a set of those around every 2 fields (or groups) you are comparing. Ex. <Where> <And> <And> <Eq> <FieldRef Name="HomeType"><Value Type="Choice">Condo</FieldRef> </Eq> <Eq> ...


0

Unfortunately, the caml date stuff pretty much sucks in SharePoint. It won't compare based on time and I think the daterangesoverlap only works for recurring events. Are the events you expect NOT to be shown recurring or single instance events?



Top 50 recent answers are included