i am looking for solution to Copy list item from one list to another list with attachment using visual studio workflow
i am able to copy list items but not attachment .if any one know how to copy attachment content from list one to list two
Technology Tips and News
i am looking for solution to Copy list item from one list to another list with attachment using visual studio workflow
i am able to copy list items but not attachment .if any one know how to copy attachment content from list one to list two
Hi,
Using this method you can copy attachments from one list item to another. You can add it to SharePoint workflow or any other action.
public void CopyItem(SPListItem srcItem, SPListItem destItem) { foreach (string attachmentName in srcItem.Attachments) { SPFile file = srcItem.ParentList.ParentWeb.GetFile(srcItem.Attachments.UrlPrefix + attachmentName); byte[] data = file.OpenBinary(); destItem.Attachments.Add(attachmentName, data); } destItem.Update(); }
Or try to use "Useful Sharepoint Designer Custom Workflow Activities".
Best Regards,
Dennis