Hot answers tagged

2

Base on your code, the value you get is a string not an object. so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using eval funtion. var relateditmObj = eval(relateditm); var relateditmid = relateditmObj[0].ItemId;


2

Try this : ---> createdDate.ToString("s")


2

Please note that date you are passing in CAML query need to be in ISO8601DateTime format. string createdDate = startDate.ToString("yyyy-MM-ddTHH:mm:ssZ"); then pass this in CAML query. Reference: http://www.codeproject.com/Articles/414414/SharePoint-Working-with-Dates-in-CAML


2

The CAML would look like: <Where> <Eq> <FieldRef Name='booleanField' /> <Value Type='Boolean'>0</Value> </Eq> </Where> If you are going to be building a lot of CAML queries, I'd highly recommend picking up the CAML Designer from http://www.biwug.be/resources.


2

Each list keeps its own IDs and you will not be able to keep them perfectly in sync. Create a helper columns and let the workflow copy the ListA ID into that field, then refer to that field as the common ID. If you use the workflow step "Create item" instead of copying an item, you can transfer any field value from the current item to the new item, as ...


1

Written a console for you. You can use it as per your need static void Main(string[] args) { using (SPSite site = new SPSite("http://spserver:1111/")) { using (SPWeb web = site.OpenWeb()) { SPList lib = web.Lists.TryGetList("TestLibrary"); SPQuery query = new SPQuery(); ...


1

A CAML query for that would look something like this <View> <Query> <Where> <Contains> <FieldRef Name='Title'/> <Value Type='Text'>username</Value> </Contains> </Where> </Query> </View> But I do wonder why you ...


1

Try using SPList.GetDataTable method MSDN: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.getdatatable.aspx public DataTable GetDataTable( SPQuery query, SPListGetDataTableOptions flags, out SPListItemCollectionPosition position ) With this method you can read with a single query all the information in a c# datatable. ...



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