.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Item loses metadata when moved.

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint

Hey all,

Been working through an interesting issue with regards to files and programmatically moving of said files.

Here is the scenario:

1) I have a form that is capturing some metadata associated with a content type.

2) I use the captured metadata to create a document from a template stored in SharePoint (the document uses the metadata to drive some server-side processing of the contents of the template to dynamically create a new document).

3) The new document is dropped off in the Drop Off Library as an intermediate staging location.

4) I make a call to determine the final location of the file based on the metadata and Content Organizer and routing rules.

5) I use SPFile.MoveTo(url) to move the file to the final location.

Now, here's the problem: once the file is moved to the final location, some of the metadata is reset to the metadata in the template document (in particular taxonomy fields).  Both locations have the same content types and when the document is dropped off for the first time at step 3, it has the correct metadata on the list item (the taxonomy fields are preserved).

The move is from the Drop Off Library to a folder in another library within the same SPWeb (same site).

What make

View Complete Post

More Related Resource Links

How to add/append metadata stored within the Sharepoint Term Store to a crawled item


Hi All,

I need someone to explain to me how to add/append metadata stored within the Sharepoint Term Store to a crawled item (i.e., can it only be done via External Content Type?). Bascially i need to know if there is any Out of the box solution for this?


Much appreciated.





Metadata properties set in list item, but don't show up in the DIP.


Hi folks,

I'm creating a document programmatically on the server side and using SPFileCollection.Add(...) to create it using the binary contents and a hashtable of the metadata properties.

This works great in SharePoint.  The SharePoint list item picks up the metadata properties and a new document item is created in the library with the proper metadata for all of the fields.  If I view the properties or go to edit the properties in SharePoint, all of the metadata is correct.

However, when I open the document in Word, it seems that none of the managed metadata fields (taxonomy field types) "stick".  The values are only for the managed metadata fields.

In SharePoint, if I change any of the fields and do a save on the list item and then open the document, the taxonomy fields "stick" when I open the document again.

I've opened up the document to view the XML and it seems that the custom properties XML doesn't change from pre-update to post-update.

I've also tried calling SPListItem.SystemUpdate(...) and SPFile.Update(), but this has yielded no results so far. 

So in summary:

  • All fields except for managed metadata fields "stick"
  • All fields show up fine in SharePoint in view and edit mode
  • Managed metadata fields are blank when Word document is open

how to remove/hide certain metadata from Calendar Event Item?

How do I remove the All Day Event, Recurrence, and Workspace fields from the calendar list? We don't need these on a specific calendar and want to keep the "new" form as simple as possible.  They don't seem to be able to be hidable either.
There are no mistakes; every result tells you something of value about what your are trying to accomplish.

programmatically set item's managed metadata value by name


I have a workflow where if all the docs in a doc set have a certain property I set a property on the doc set itself.  I already can figure out if I want to set the value

1. how do I set a list item value to a managed metadata value?

2. Is there a way to do this by name and not guid?  I have the column in question so if I had to somehow loop on the possible options, I could select it.



Metadata won't apply to one library item

We have a doc library we have been using for a short time.  I just added a new column for metadata and am going back into the few dozen docs in the library to Edit Properties to add this metadata.  I have one library item that will not retain this new metadata when I apply it.  I even tried deleting the library list item, and re uploading it.  This did not work to solve the issue.
There are no mistakes; every result tells you something of value about what you're are trying to accomplish.

Using Quick Parts with document libary, template loses field association when moved

Using Quick Parts with document libary, losing association with columns
Hi, I hope someone can help.  Sorry for length
Office Sharepoint 2007 version with Office 2007

The Situation:
We have a workflow which is used to progress a set of Change Control procedures. This utalises a task list, where as each task is complete, the workflow writes the values gathered from the task forms into a word document.  We have a content type associated with a task list with a corresponding content type created on the document library list to hold the values that users enter.  We also use a word 2007 template which has quick parts added to it and its these quick parts that get populated with the user data as the workflow progresses.  So we can populate a customer change request form for users.  This is all deployed using a feature.

The problem:
In our test environment this works fine.  As the workflow progresses the document library columns get updated with the task list columns data, as expected, which in turn means the word document gets updated with the correct values.  All good!!
However, when we move the whole solution onto out live environment, (we do this using visual studio to package all code and depl

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







LINQ to SQL - Validating if item is in Database, but if item is not items not inserting into databas



I am new to this, so bear with me.  I am writing an application in C# that uses LINQ to validate a datacontext off a textbox to see if the record exists already.  If the record does exist I inserted an if statement to advise the user that the record exists, if the record does not exist I would like to allow the record to be added to the database.  If I take out my else statement everything works fine as far as inserting goes, but I do not want to allow inserts in this scenario.  I have tried moving the if and else statement to different parts of the code but can't quite figure this one out.  Any help would be apprecaited, attached is the code.  This code is set to a button press.  As a matter of fact, if you see any other errors along the way please feel free to point them out. 



    protected void enterBTN_Click(object sender, EventArgs e)
        //make new data context

        SHCDataContext insNewAll = new SHCDataContext();
        //LINQ to check if customer exists in database
        var checkExisting = from c in insNewAll.Customers
                            where c.custLastName.Contains(custLastNameTB.Text.ToString())
                            select c.custLastName;
        //make list to store values

Compiler Error Message : CS0006: Metadata file 'System.EnterpriseServices.dll' could not be found


I get this error when i Debug my web application....


I followed these steps.,

  • Ended the aspnet_wp.exe process in the Windows Task Manager
  • Then deleted the application`s folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
  • Then started Visual Studio 2008 again

I also rebooted my system but no use....

Plz help !

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

Extreme ASP.NET: Model Validation & Metadata in ASP.NET MVC 2


Scott Allen shows how to improve your user input validation with new features coming out in ASP.NET MVC 2 that easily allow validation on both the client and server.

Scott Allen

MSDN Magazine March 2010

"Oslo" Basics: Build Metadata-Based Applications With The "Oslo" Platform


We introduce you to "Oslo" and demonstrate how MSchema and MGraph enable you to build metadata-driven apps. We'll define types and values in "M" and deploy them to the repository.

Chris Sells

MSDN Magazine February 2009

Office Development: Manage Metadata with Document Information Panels


Here the author uses Document Information Panels in the Microsoft 2007 Office system to manipulate metadata from Office docs for better discovery and management.

Ashish Ghoda

MSDN Magazine April 2008

Team System: Work Item Tracking


In this column, Brian Randell explains how to build a simple Work Item explorer and demonstrates the core operations needed to add work item support when building your own add-in.

Brian A. Randell

MSDN Magazine April 2007

Visual Studio 2005: Create Reusable Project And Item Templates For Your Development Team


Visual Studio 2005 introduces a new model that lets you define your own project templates and starter kits, something developers have been requesting for some time. Here Matt Milner shows you how to consume, create, and customize these templates.

Matt Milner

MSDN Magazine January 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend