Virtual Happy Hour is canceled this month (March) due to Good Friday.
Try our conversational search powered by Generative AI!
AI OnAI Off
Virtual Happy Hour is canceled this month (March) due to Good Friday.
Hi Adam!
Check out the class EPiServer.DataAbstraction.PageDefinition, it contains the method Delete().
You can call PageDefinition.ListDynamic() to get a list of all dynamic pagedefinitions, and then iterate upto the one you want to remove.
Hope this helps,
Johan
Many thanks for this Johan, that is exactly what I was looking for.
Code snippet:
PageDefinitionCollection allDynamicProperties = PageDefinition.ListDynamic();
foreach (PageDefinition pd in allDynamicProperties ){
if (pd.Name == propertyName)
{
pd.Delete();
break;
}
...
/\dam
Can anybody please tell me how to delete dynamic properties from the system in code?
We have a number of sites that need the DBs tidying up, and I would like to automate the process.
Many thanks,
/\dam