Hi Christer,
I am also interested in doing something similar to what you have spoken about in this post. The Max Versions attribute doesn't have any effect on the 'Not ready' versions and I would like them limited as well. Do you know if this is possible? Any advice would be gratefully recieved.
Many Thanks,
Ella
Hi
One way to do this is to attach to a suitable DataFactory event. For example SavedPage, that is executed every time a page is saved.
In that event you could load all the versions for that page and delete the ones that you do not want to keep any more. Something like this to delete all not ready versions:
foreach (PageVersion version in PageVersion.List(e.PageLink))
{
if (version.Status == VersionStatus.CheckedOut)
DataFactory.Instance.DeleteVersion(version);
}
I do not recommend deleting rows directly in the database.
Regards
Per Gunsarfs
EPiServer CMS development team