November Happy Hour will be moved to Thursday December 5th.

Programatically create a dynamic property

Vote:
 

Is it possible to programatically create a dynamic property?

If a specific dynamic property is missing I would like to create it for the editor...

#26554
Dec 10, 2008 20:35
Vote:
 

That is possible.

If you dont add PageTypeID the property will be a dynamic property

otherProp = new PageDefinition();

otherProp.FieldOrder = prop.FieldOrder;

otherProp.Type = new PageDefinitionType(prop.Type.ID, prop.Type.DataType, prop.Type.Name);

otherProp.PageTypeID = page.ID;

otherProp.Tab = prop.Tab;

otherProp.Name = prop.Name;

otherProp.HelpText = prop.HelpText;

otherProp.EditCaption = prop.EditCaption;

otherProp.Searchable = prop.Searchable;

otherProp.Required = prop.Required;

otherProp.LanguageSpecific = prop.LanguageSpecific;

otherProp.LongStringSettings = prop.LongStringSettings;

otherProp.Save();

otherProp.ClearCache();

#26558
Dec 11, 2008 10:18
Vote:
 

Cool! Thanks a lot!

Cool

#26617
Dec 12, 2008 22:33
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.