caml

Sharepoint Deleting an Item from a list using UpdateListItems WebService

I am trying to delete an item from a list and have the following xml <Batch PreCalc='TRUE' OnError='Continue'> <Method ID='1' Cmd='Delete'>\ <Field Name='ID'>185</Field> </Method> </Batch> This is returning the following error 0x81020030 - Invalid file name The file name you specified could not be used. It ma...

How does SharePoint store the CAML for a view's filter?

I'm trying to create a CAML query for a list in SP. I thought of using the Modify view pages to create a basic view including a filter, then use some code to examine the Query Prop of the SPView: string t = dataList.Views["MyView"].Query; But CAML in t does not contain any Where elements. Just the orderby <OrderBy> <FieldRef Nam...

Update SharePoint file field that is of type choice muliple selection

I am using UpdateListItems method (Lists.asmx web service) to update fields of an uploaded document in one SharePoint document library. In my case, I have a document library called Schedules. In it, there's a field called 'Day of the Week' which is a Choice multiple selection, with the allowed values Monday to Sunday. Here's the query th...

SPListItemCollection.GetDataTable() doesn't return all columns?

I ran into an issue when using the GetDataTable() method. I'm trying to return the default SharePoint column "FileRef" in my results to use. I include it in my SPQuery.ViewFields Query: <Where><IsNotNull><FieldRef Name='FileRef'/></IsNotNull></Where> ViewFields: <FieldRef Name='Title' /><FieldRef Name='Category' /><FieldRef Name='Fi...

why GetSiteData(query) returns wrong values

Hi. I do a caml query on the forms libraries in entire site collection with SPWeb.GetSiteData(SPQuery). For the field "ServerUrl" it returns just "/" instead of "/site name/library name/formName.xml". With item["ServerUrl"] is returns the right value, but i need to use the GetSiteData method. Here is my code: SPSiteDataQuery q = new SP...

CAML query that includes folders in result set

I'm trying to write a CAML query that executes against a specific SPList, scoped to a specific folder, recursive from that point, and returns all ListItems (which meet a criteria) and Folders. Here's the code for the query which seems like it should work (formatted for readability): SPQuery query = new SPQuery(); query.Query = " <Where...

Sharepoint ListTemplate Multiple Content Types - Ref Fields

I am trying to create a list template in SharePoint Feature using CAML. I have two content types "News" and "News Release" they both share two fields called Overview and Description. I have been reading that the "listtemplate" caml element does not automatically add the fields from the content types, you need to specify all the fields. ...

Sharepoint: How to refresh the SpNavigationNodeCollection?

Hi, I have a Sharepoint 2007 website. As you know,in settings users can order the sites and pages as they want in exploration, and then you can get these items with this order with: SPWeb web = CurrentSite.OpenWeb(currentSite); SPNavigation nav = web.Navigation; SPNavigationNodeCollection nodeColl = nav.QuickLaunch; The problem is...

SharePoint CAML OrderBy Modified does not work

I have made a query against a list. I want to get the last modified item which meets a certain condition, and my query looks like this: <Query><OrderBy><FieldRef Name='Modified' Ascending='FALSE' /></OrderBy><Where><Eq><FieldRef Name='kortnummer'/><Value Type='String'>kv11</Value></Eq></Where></Query> I get the listitems i need, just...

SharePoint CAML search on Modified By

What do I use in the value to return results using the following CAML query in MOSS2007? The query is currently not returning any results. I have tried using the Account Name and the name displayed in the list but to now avail. <Eq><FieldRef Name='Modified_x0020_By' /><Value Type='User'>domain\someusername</Value></Eq> ...

WSS GetListItems Not Returning Folders without Inherited Permissions when Calling with GUID

WSS 3.0 List Service I am running GetListItems() on a Picture Library (name Pictures) using the follow CAML query: <Query> </Query> <ViewFields> <FieldRef Name="EncodedAbsUrl"/> <FieldRef Name="Title"/> <FieldRef Name="ContentType"/> </ViewFields> <QueryOptions> <Folder>Pictures\Uploads</Folder> <ViewAttributes Scope="Recur...

How to filter list using CAML query from a custom search field?

Hi, Background I'm configuring a custom WSS application that focuses around one main list. I want to replace the top sharepoint search box with my custom search. After clicking on search I want to load a page with a webpart presenting the results (basically filtered list using CAML query). I'm using WSS not MOSS so I cannot just confi...

SharePoint List View - DateTime in the Query String

I am writing a view for a list of events in SharePoint (Schema.xml) and I want to filter the results according to a DateTime (i.e. only display the events that start between 2 dates) Normally I would use a CAML Query like this one for example : <Where> <And> <Geq> <FieldRef Name="Even...

Get items from sharepoint list by Title field with ignore care using Caml or SPQuery

I want to get data from SharePoint List using CAML and filtered by Title with ignore case like <Query> <Where> <Eq> <FieldRef Name='Title' /> <Value Type='Text'>Car</Value> </Eq> </Where> </Query> But with ignore case so if i have an item with title: car the caml should return it how can I do this? ...

Accessing last record in a sharepoint list via CAML query

hi,i ve some problem in accessing last record from sharepoint list through CAML query,can any one help me in this regrad;i have a sample list called 'MainHeads' which contains the information like HeadID,Category,and headName.... Mehboob Pakistan ...

Retrieve all Master Pages for a SharePoint Site?

Hi, How can I determine programmatically what master pages (custom and OOTB) that are available for to use for a web site in SharePoint? Thanks, MagicAndi ...

CAML Query find records where parameter does not exist?

I have a sharepoint list which has several fields. It seems that when a field is left blank on one of the records - that attribute is missing on the field when I query the list using a CAML Query. Is it possible to write a query to return the records which do not contain this attribue? Example: id Employee Title description --------...

CAML Query Documents for Workflows

Hi All, I'm using Sharepoint 2007. Is there a way to CAML query documents (in this example with a ContentType of Invoice) that do not have any workflows assigned to them? I realize I can pull back all of the Invoices using something like this: SPQuery query = new SPQuery(); query.ViewAttributes = "Scope=\"RecursiveAll\""...

SharePoint field not showing in Display/Edit/New pages

I've written a schema for a list that only needs to add one column to the default custom list which is a number field called months. The field is shown on the default view and is indeed created on the list. The list is autopopulated with values which get set properly. The problem is that the field doesn't appear on the display/edit/new p...

Deleting record in sharepoint list

Hi I want to delete records in list view in sharepoint. This should only be a logical delete the actual data itself should not be deleted . How to accomplish thsi ? Please suggest ...