SDL Developer
SDL Developer

Reputation: 612

Tridion Core Service: How to update system properties of component/ multimedia component

I have a requirement where I need to update system properties (mainly created & modified date) of component / multimedia component. But while creating component I can access only Title property through which I can set name of component, so is there a way to update created and modified date through code as well.

In most of the repositories like Filenet etc system properties are not directly editable but after some configuration changes, system properties are also editable.

In SDL Tridion too after changing configuration file we can make other system properties editable? If yes then where exactly I need to do changes?

Below is the code I'm using to create a component:

core_service.ServiceReference1.SessionAwareCoreService2010Client client = 
    new SessionAwareCoreService2010Client();

client.ClientCredentials.Windows.ClientCredential.UserName = "myUserName";
client.ClientCredentials.Windows.ClientCredential.Password = "myPassword";

client.Open();

ComponentData component = (ComponentData)client.GetDefaultData(
                                     ItemType.Component, folderUri);
component.Title = targetFileName;
component.ComponentType = ComponentType.Normal;

Please suggest.

Upvotes: 1

Views: 378

Answers (3)

Jeremy Grand-Scrutton
Jeremy Grand-Scrutton

Reputation: 2802

If you want to maintain date information between systems where migration is taking place then a good approach would be to add "created" and "modified" date fields as metadata to the items being migrated. You would then need to populate these fields with the appropriate values prior to exporting them from the source repository.

There is no other supported approach that I can think of.

Upvotes: 3

Shekhar Gigras
Shekhar Gigras

Reputation: 654

You can't modified and created through core srevice or any interface becuase tridion mainting the version.

you can set the created and revision date but core service will not change date.

Upvotes: 0

Chris Summers
Chris Summers

Reputation: 10163

As stated by @Jeremy, these are read only properties. It is very rare that these values will ever be used for something other than providing information for editors.

Perhaps if you can explain you business requirments, someone can provide an alternative solution.

Upvotes: 1

Related Questions