A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
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