Copy List Item Extended Activity doesn't not support Content Types....

Aug 7, 2012 at 10:00 PM

Awesome tool.  Really helped me out.  I did notice a  problem with the activity.  If the source item is of a different content type than the destination item, it will use whatever is the default on the target list.

Please note that I'm referring specifically to Item based content types, not Document based content types.

In the item case, if a single line is added to the CopyListItem method in ListItemCopier.cs, it works fine...

As follows:

        /// <summary>
        /// handles copying of list items
        /// </summary>
        protected virtual int CopyListItem()
        {
            SPListItem destItem = DestinationList.Items.Add();

            // added the adjustment to ensure the same content type.
            destItem["ContentTypeId"] = SourceItem.ContentTypeId;
            CopyFieldValues(SourceItem, destItem);

            // attachment routine
            if (SourceList.EnableAttachments && DestinationList.EnableAttachments)