splistitem

Copying List Items from Master List to sub sites

若如初见. 提交于 2019-12-08 14:51:14
问题 I have a site which contains a custom list Master. I have a number of sub sites which contain copies of this list. When someone edits or adds a new list item to the master list, I would like all sub sites to be updated accordingly by an event handler which is associated with the master list. e.g. if item is added, add it to the list of each sub site if item is updated, update the appropriate list item of each sub site if item is deleted, delete the appropriate list item from each sub site I

How to copy SPListitem from one SPList to Another SPList

允我心安 提交于 2019-12-04 05:23:30
问题 I have requirement to copy items from one SPList to another, Here is the code which is not working: public void CopyList(SPList src) { //Copy items from source List to Destination List foreach (SPListItem item in src.Items) { if(isUnique(item.UniqueId)) { foreach (SPField field in src.Fields) { try { if (!field.ReadOnlyField) newDestItem = DestinationList.Items.Add(); newDestItem[field.Id] = item[field.Id]; newDestItem.Update(); } catch (Exception ex) { ex.ToString(); } } //newDestItem[

When is SPFile.Properties != to SPFile.Item.Properties in SharePoint?

孤人 提交于 2019-12-01 16:12:15
One of our customers has a problem that we cannot reproduce. We programmatically copy a document's properties to a destination file using SPFile.Properties. However, for some reason the file's properties do not match the meta data specified on the list the file is stored in. Now, we can probably solve this by copying SPFile.Item.Properties (not tested yet), but I am just wondering under what circumstances SPFile.Properties is unequal to SPFile.Item.Properties. Update: We have just received an update from our customer. Using SPFile.Item.Properties always returns the up to date information.

When is SPFile.Properties != to SPFile.Item.Properties in SharePoint?

泄露秘密 提交于 2019-12-01 15:08:08
问题 One of our customers has a problem that we cannot reproduce. We programmatically copy a document's properties to a destination file using SPFile.Properties. However, for some reason the file's properties do not match the meta data specified on the list the file is stored in. Now, we can probably solve this by copying SPFile.Item.Properties (not tested yet), but I am just wondering under what circumstances SPFile.Properties is unequal to SPFile.Item.Properties. Update: We have just received an

Finding SharePoint list item by its display form's URL

无人久伴 提交于 2019-11-30 21:18:36
问题 Sometimes users require to change information in SharePoint list item that is not editable for them, for instance, a field that is hidden in edit form (in my case it was the records number). I decided to create a small Windows GUI application that the administrator would run on the server and make the requested change. However, the simplest scenario to get an instance of a SPListItem I found was: the admin enters the URL of the root site an SPSite ojbect is created, using the given URL: