Developer forum

Forum » Development » Recommended way to extend an existing item

Recommended way to extend an existing item

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

 

What's the recommended way to extend an existing item type? For example, what if I want to add a property to a type that already exists? It seems that new columns aren't picked up automatically. I can also imagine that renaming a property can be pretty complex.

 

Is it enough to manually update the database schema?

Imar

 


Replies

 
Morten Bengtson
Reply

I'm not sure that it is the recommended way, but you could try to delete the meta data file located in /Files/System/Items and then recycle the app pool. That should make Dynamicweb pick up the additional properties.

 

Changing property names will probably not work as there is no way for Dynamicweb to know that the property "Foo" should replace property "Bar". You would have to rename the column in the database manually.

Changing the display name should not cause any problems. Just use the FieldAttribute on your property, like [Field("My field name")]

 

You might want to hang on to the old meta data file in case you have entered item names, descriptions, options etc. You have to transfer those manually to the new meta data file or enter the values again.

 

You must be logged in to post in the forum