Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
Thanks Per!
this is what i had to do:
producLink is my contentreference
var versionRepo = ServiceLocator.Current.GetInstance<IContentVersionRepository>();
var latestVersion = versionRepo.List(productLink).Last().ContentLink;
// get the last item in array
versionRepo.SetCommonDraft(latestVersion);
//set the last item as default
don't forget to use SaveAction.ForceCurrentVersion when saving
Hi
we are saving pages from code but when looking in cms we can´t see the latest saved version
how do we set the latest saved version to default ?
thanks!
Regards
Pawel