I have hundreds of pages that are using the same page metadata and I would like to set an specific value in one of this fields that is a text with C# or other automatic way. Does anyone knows how to do it? Thanks in advance.
On Tridion 2009 you should use the TOM Interop APIs (COM) which are provided under Tridion\bin\Client\PIA. You'll need to use the
Create a new Tridion session with code like this:
If the current Windows user is a valid Tridion user, then it will just work. If it's not it's a bit more complex, you need to run under a valid Impersonation account, then call
Then you need to find all pages that may contain the value - you probably want to do something like a "Where Used" on that schema that gives you all the pages:
Now you have an XML Document that contains all the IDs of all Pages that use the schema you loaded ("tcm:123-99-8" in the example above).
Next, you need to load each individual page in a loop, get the fields, update them, save the page, move on to the next. Something along these lines:
I haven't tested that code, just found it lying around in an old project...
EDIT As Bart suggests, all these COM objects should be released with
Since you are on version 2009 your options are a bit limited, you would either use the Business Connector (SOAP) API, or the TOM API directly on the server.
For the TOM API you could write a ASP Page, or you can do an ASPX Page (with C#), but then you have to use the TOM Interop, and run it from the Custom Pages. I don't think I have any direct examples of how to do that, it has been more than 3 years ago since I wrote stuff like that.
Probably not what you wanted to hear, but I would suggest upgrading to SDL Tridion 2013, and then you can use the Core Service to easily write an application in C# to suit your needs. You will also find a lot more examples online on how to do such things.