Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am copying a file between 2 libraries which contain the same fields. So basically the source library serves as a template library. After the file is copied i update the field values in the destination library. When i open the document and look at the DIP the values are shown correctly.

However, all quickparts in the document look like they have lost their databinding and won't show the new item's field values. When I delete a QuickPart and add a quickpart for the same field it will have the correct value.

Code:

 //doc is the sourceitem
 var newFile = destinationList.RootFolder.Files.Add(fileName, doc.File.OpenBinary(), true); 
 // set field values on the item
 DocumentManager.FillListItem(data, newFile.Item); 
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Found it! The destination library had it's default content type still set to Document instead of my custom content type. When you copy the bits, it will get the default ctype which does not have those fields so the bindings are invalid! Even setting the content type afterwards doesn't fix things.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.