I have a case where I need to set the PageStopPublish of a page, based on the value of another property, but PageStopPublish doesn't seem to get set.
I noticed that it is possible to set the stop publish in the SetDefaultValues property, but this is too early in the flow, so what I've tried is this.
public virtual DateTime? DueDate { get { return this.GetPropertyValue(x=>x.DueDate); } set { if (value != null) { this.Property["PageStopPublish"].Value = value; this.StopPublish = value; } this.SetPropertyValue(x => x.DueDate, value); }
but the stop publish doesn't seem to get set in the UI.
I've also tried adding the DueDate property as a fullrefresh property but even then the StopPublish isn't set.
Is it possible to solve this without a global event handler ?
Have you tried using PageData.StopPublish property instead of PageData.Property["PageStopPublish"]?
Edit: Oh, on the next line, I see :) Property indexing is not necessary when using it.
I have a case where I need to set the PageStopPublish of a page, based on the value of another property, but PageStopPublish doesn't seem to get set.
I noticed that it is possible to set the stop publish in the SetDefaultValues property, but this is too early in the flow, so what I've tried is this.
but the stop publish doesn't seem to get set in the UI.
I've also tried adding the DueDate property as a fullrefresh property but even then the StopPublish isn't set.
Is it possible to solve this without a global event handler ?